internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: oppia/oppia

Issue:
Design and implement the new version of the profile page.
Tasks:
- [x] design the mocks for mobile screens (in progress)
- [x] implement the basic structure of the new profile page redesign on both desktop (two columns) and mobile (one section above the other)
- [x] implement the "profile" section (containing the username, bio, picture and subject interests)
- [x] implement the "portfolio" section (the one containing the list of explorations)
- [x] implement paging for the "portfolio" section
- [ ] implement the in-place editing flow for the "profile" section



Discussion:
Relevant design doc: https://docs.google.com/document/d/116lb6qtIlEDqxKy7WUpO9R9neoenKbsgAkIHHMLp4QU/edit


Resolving patch:
diff --git a/core/controllers/profile.py b/core/controllers/profile.py
--- a/core/controllers/profile.py
+++ b/core/controllers/profile.py
@@ -58,7 +58,7 @@ def get(self, username):
 
         self.values.update({
             'nav_mode': feconf.NAV_MODE_PROFILE,
-            'PROFILE_USERNAME': username,
+            'PROFILE_USERNAME': user_settings.username,
         })
         self.render_template('profile/profile.html')
 
@@ -91,6 +91,7 @@ def get(self, username):
                     user_contributions.edited_exploration_ids))
 
         self.values.update({
+            'profile_username': user_settings.username,
             'user_bio': user_settings.user_bio,
             'subject_interests': user_settings.subject_interests,
             'first_contribution_msec': (


Test patch:
Repository: oppia/oppia

Issue:
Add an OutputContains rule to the CodeRepl interaction.
We've had a request to add an OutputContains rule to the CodeRepl interaction.

The use case is as follows: the student will type in the body of a function, and their code will be checked by calling the function on several inputs and printing the results. We don't want to stop the student from printing their own stuff from the function first, though, hence the idea of checking to see whether a substring of the student's output matches the expected output.

Note that this is a straightforward starter project. The files to modify are extensions/interactions/CodeRepl/CodeRepl.js (see codeReplRulesService) and the corresponding test suite in extensions/interactions/CodeRepl/CodeReplRulesServiceSpec.js.

/cc @anuzis 



Discussion:
Hi @abhijit5893, this might be a good one to start off with, I think. It's a small backend project that ties into the code interaction. Would you like to take it on? 

@seanlip  Sure. I think this would be a good start. 


Resolving patch:
diff --git a/extensions/rules/code_evaluation.py b/extensions/rules/code_evaluation.py
--- a/extensions/rules/code_evaluation.py
+++ b/extensions/rules/code_evaluation.py
@@ -30,6 +30,8 @@ class CodeContains(base.CodeEvaluationRule):
 class CodeDoesNotContain(base.CodeEvaluationRule):
     description = 'has code that does not contain {{x|CodeString}}'
 
+class OutputContains(base.CodeEvaluationRule):
+    description = 'has output that contains {{x|CodeString}}'
 
 class OutputEquals(base.CodeEvaluationRule):
     description = 'has output equal to {{x|CodeString}}'


Test patch:
diff --git a/core/domain/rule_domain_test.py b/core/domain/rule_domain_test.py
--- a/core/domain/rule_domain_test.py
+++ b/core/domain/rule_domain_test.py
@@ -26,7 +26,7 @@
 import feconf
 
 
-EXPECTED_TOTAL_NUMBER_OF_RULES = 47
+EXPECTED_TOTAL_NUMBER_OF_RULES = 48
 
 
 class FakeRule(rule_domain.Rule):
Repository: oppia/oppia

Issue:
Misnamed function in core.domain.exp_services
In core.domain.exp_services, _get_exploration_summary_dicts_from_models() is misnamed. This function returns exploration summary domain objects, so its name should really be _get_exploration_summaries_from_models(). The name should be changed here and in all the callers.

In addition, it would be nice to spot-check exp_services.py for other examples of bad names that don't match their docstrings.

/cc @giritheja 



Discussion:

Resolving patch:
diff --git a/core/domain/exp_services.py b/core/domain/exp_services.py
--- a/core/domain/exp_services.py
+++ b/core/domain/exp_services.py
@@ -292,7 +292,7 @@ def get_exploration_titles_and_categories(exp_ids):
     return result
 
 
-def _get_exploration_summary_dicts_from_models(exp_summary_models):
+def _get_exploration_summaries_from_models(exp_summary_models):
     """Given an iterable of ExpSummaryModel instances, create a dict containing
     corresponding exploration summary domain objects, keyed by id.
     """
@@ -363,7 +363,7 @@ def get_non_private_exploration_summaries():
     """Returns a dict with all non-private exploration summary domain objects,
     keyed by their id.
     """
-    return _get_exploration_summary_dicts_from_models(
+    return _get_exploration_summaries_from_models(
         exp_models.ExpSummaryModel.get_non_private())
 
 
@@ -371,7 +371,7 @@ def get_all_exploration_summaries():
     """Returns a dict with all exploration summary domain objects,
     keyed by their id.
     """
-    return _get_exploration_summary_dicts_from_models(
+    return _get_exploration_summaries_from_models(
         exp_models.ExpSummaryModel.get_all())
 
 


Test patch:
diff --git a/core/domain/exp_services_test.py b/core/domain/exp_services_test.py
--- a/core/domain/exp_services_test.py
+++ b/core/domain/exp_services_test.py
@@ -50,7 +50,7 @@
 }
 
 def _count_at_least_editable_exploration_summaries(user_id):
-    return len(exp_services._get_exploration_summary_dicts_from_models(  # pylint: disable=protected-access
+    return len(exp_services._get_exploration_summaries_from_models(  # pylint: disable=protected-access
         exp_models.ExpSummaryModel.get_at_least_editable(
             user_id=user_id)))
Repository: oppia/oppia

Issue:
Have Profile Picture Hyperlink to Preferences
Currently, the steps to change one's profile picture involve signing in, and going to preferences, and then changing said picture; however, the typical user's first instinct is to click on the profile tab and click on their picture to change it. The proposed behavior being that as long as the image is one's _own_ profile image, then it should redirect them to preferences to change the picture; thus making changing the picture more intuitive. However, if one were to, say, click on another user's profile picture, it should _not_ allow the current user to change _another_ user's picture.



Discussion:
To clarify the proposed behavior:
- If you are logged in, then when you go to /profile, clicking the profile image should take you to /preferences.
- If you are not logged in, or if you are logged in and go to someone else's profile page, the profile image should not be clickable.

@p4rsec -- have you had a chance to make further progress on this? Once you've done so, please submit a PR.

Hi @p4rsec -- any luck?

@seanlip apologies for not communicating formally within the issue (I should have continued the updates outside of Gitter). I have reached an interesting roadblock in the solution. Originally, at first test, the inserted line of code created a hyperlink on the profile image; however, on recent tests the entire page has become a hyperlink. I may attempt to clear out my fork and try again, however it may also be that I have some error on my line of code. In other news, (I think I've asked this before) where would be the best place to store the code for determining whether or not the user is in fact the same user as the one on the profile page? 

@p4rsec For determining whether the current user is the same as the user in profile page you can try using an ng-if statement. I think you can compare `{{username}}` with `{{PROFILE_USERNAME}}`.

Thanks, @AllanYangZhou . I'll try that!


Resolving patch:
diff --git a/core/controllers/profile.py b/core/controllers/profile.py
--- a/core/controllers/profile.py
+++ b/core/controllers/profile.py
@@ -89,8 +89,10 @@ def get(self, username):
             edited_exp_summary_dicts = (
                 summary_services.get_displayable_exp_summary_dicts_matching_ids(
                     user_contributions.edited_exploration_ids))
+        profile_is_of_current_user = (self.username == username)
 
         self.values.update({
+            'profile_is_of_current_user': profile_is_of_current_user,
             'profile_username': user_settings.username,
             'user_bio': user_settings.user_bio,
             'subject_interests': user_settings.subject_interests,


Test patch:
Repository: oppia/oppia

Issue:
Add a flag to enable minified version locally for developers.
Currently, when we run Oppia locally it starts in development mode. Naturally, in development mode we'd want to debug things and hence we do not use the minified versions of HTML / CSS / JS. 

Now, to perform performance testing of Oppia we'd like to better simulate the production environment and hence, enable minified versions of HTML / CSS / JS.

Essentially, we need to add a flag for developers to run Oppia locally that serves the same content as it is served when in production, i.e, with minified versions of HTML / CSS / JS.

/cc @seanlip @MAKOSCAFEE @BenHenning



Discussion:
Hi @MAKOSCAFEE -- any progress on this?


Resolving patch:
diff --git a/appengine_config.py b/appengine_config.py
--- a/appengine_config.py
+++ b/appengine_config.py
@@ -84,6 +84,7 @@ def save(self):
 # In the GAE production environment, numpy is automatically provided, and
 # trying to access a path outside the oppia/ directory will lead to an error.
 # So, we only add numpy to the system path in development mode.
+# Or, if we pass the flag to emulate production mode while in development mode.
 if feconf.DEV_MODE:
     THIRD_PARTY_LIBS.append(
         os.path.abspath(os.path.join(
diff --git a/core/controllers/base.py b/core/controllers/base.py
--- a/core/controllers/base.py
+++ b/core/controllers/base.py
@@ -320,6 +320,7 @@ def render_template(
             'CAN_SEND_ANALYTICS_EVENTS': feconf.CAN_SEND_ANALYTICS_EVENTS,
             'DEFAULT_LANGUAGE_CODE': feconf.ALL_LANGUAGE_CODES[0]['code'],
             'DEV_MODE': feconf.DEV_MODE,
+            'MINIFICATION': feconf.IS_MINIFIED,
             'DOMAIN_URL': '%s://%s' % (scheme, netloc),
             'ACTIVITY_STATUS_PRIVATE': (
                 rights_manager.ACTIVITY_STATUS_PRIVATE),
diff --git a/feconf.py b/feconf.py
--- a/feconf.py
+++ b/feconf.py
@@ -20,6 +20,7 @@
 import datetime
 import os
 
+
 # Whether to unconditionally log info messages.
 DEBUG = False
 
@@ -27,6 +28,10 @@
 # code in core/platform.
 PLATFORM = 'gae'
 
+# This should be string comparison, since all environment variables
+# are converted to string
+IS_MINIFIED = os.environ.get('MINIFICATION') == 'True'
+
 # Whether we should serve the development or production experience.
 if PLATFORM == 'gae':
     DEV_MODE = (
@@ -45,7 +50,10 @@
 RULES_DIR = os.path.join('extensions', 'rules')
 
 OBJECT_TEMPLATES_DIR = os.path.join('extensions', 'objects', 'templates')
-TEMPLATES_DIR_PREFIX = 'dev' if DEV_MODE else 'prod'
+
+# Choose production template if minification flag is used or
+# if in production mode
+TEMPLATES_DIR_PREFIX = 'prod' if (IS_MINIFIED or not DEV_MODE) else 'dev'
 FRONTEND_TEMPLATES_DIR = os.path.join(
     'core', 'templates', TEMPLATES_DIR_PREFIX, 'head')
 DEPENDENCIES_TEMPLATES_DIR = os.path.join('extensions', 'dependencies')


Test patch:
Repository: oppia/oppia

Issue:
Update 'Return to Gallery' button to 'Return to Library'
There's still a piece of Oppia that retains the old ways, currently, when a user completes an exploration the user is presented with a 'Return to Gallery' button, it should read 'Return to Library'.



Discussion:

Resolving patch:
diff --git a/core/controllers/library.py b/core/controllers/library.py
--- a/core/controllers/library.py
+++ b/core/controllers/library.py
@@ -52,7 +52,7 @@ def get_matching_activity_dicts(query_string, search_cursor):
 
     if len(activity_list) == feconf.DEFAULT_QUERY_LIMIT:
         logging.error(
-            '%s activities were fetched to load the gallery page. '
+            '%s activities were fetched to load the library page. '
             'You may be running up against the default query limits.'
             % feconf.DEFAULT_QUERY_LIMIT)
     return activity_list, new_search_cursor
diff --git a/core/domain/summary_services.py b/core/domain/summary_services.py
--- a/core/domain/summary_services.py
+++ b/core/domain/summary_services.py
@@ -150,10 +150,11 @@ def get_learner_collection_dict_by_id(
 
 def get_displayable_collection_summary_dicts_matching_ids(collection_ids):
     """Returns a list with all collection summary objects that can be
-    displayed on the gallery page as collection summary tiles.
+    displayed on the library page as collection summary tiles.
     """
-    collection_summaries = collection_services.get_collection_summaries_matching_ids( # pylint: disable=line-too-long
-        collection_ids)
+    collection_summaries = (
+        collection_services.get_collection_summaries_matching_ids(
+            collection_ids))
     return _get_displayable_collection_summary_dicts(collection_summaries)
 
 


Test patch:
Repository: oppia/oppia

Issue:
Collection editor should have a settings page
This is originally from #1462:

There should be a settings tab for editing the title, category, and objective in the same way as the exploration editor. The category should be edited using a drop-down menu of categories.

This functionality cannot be implemented until #1587 is completed.



Discussion:
I will work on it if it's ok. :)

(De-assigning until #1587 is finished.)


Resolving patch:
diff --git a/core/controllers/collection_editor.py b/core/controllers/collection_editor.py
--- a/core/controllers/collection_editor.py
+++ b/core/controllers/collection_editor.py
@@ -122,15 +122,14 @@ def get(self, collection_id):
                 rights_manager.ACTIVITY_TYPE_COLLECTION, collection_id))
 
         self.values.update({
-            'is_private': rights_manager.is_collection_private(collection_id),
             'can_edit': can_edit,
-            'collection_id': collection.id,
-            'title': collection.title,
             'can_unpublish': rights_manager.Actor(
                 self.user_id).can_unpublish(
                     rights_manager.ACTIVITY_TYPE_COLLECTION, collection_id),
-            'SHOW_COLLECTION_NAVIGATION_TAB_SETTINGS': (
-                feconf.SHOW_COLLECTION_NAVIGATION_TAB_SETTINGS),
+            'collection_id': collection.id,
+            'is_private': rights_manager.is_collection_private(collection_id),
+            'nav_mode': feconf.NAV_MODE_CREATE,
+            'title': collection.title,
             'SHOW_COLLECTION_NAVIGATION_TAB_HISTORY': (
                 feconf.SHOW_COLLECTION_NAVIGATION_TAB_HISTORY),
             'SHOW_COLLECTION_NAVIGATION_TAB_FEEDBACK': (
diff --git a/feconf.py b/feconf.py
--- a/feconf.py
+++ b/feconf.py
@@ -444,7 +444,6 @@ def get_empty_ratings():
 # Unfinished features.
 SHOW_TRAINABLE_UNRESOLVED_ANSWERS = False
 ENABLE_STRING_CLASSIFIER = False
-SHOW_COLLECTION_NAVIGATION_TAB_SETTINGS = False
 SHOW_COLLECTION_NAVIGATION_TAB_HISTORY = False
 SHOW_COLLECTION_NAVIGATION_TAB_FEEDBACK = False
 SHOW_COLLECTION_NAVIGATION_TAB_STATS = False


Test patch:
Repository: oppia/oppia

Issue:
Remove glyphicons from the codebase.
We want to standardize the use of icons across the Oppia codebase, and are moving away from glyphicons towards material-design icons.

The aim of this issue is twofold:
- add a new pattern check in `BAD_PATTERNS` in `scripts/pre_commit_linter.py` that checks for "glyphicon" and asks the developer to "Please use material icons instead of glyphicons for consistency."
- convert all remaining instances of glyphicon to material icons

Note: there were only about 10 last time I checked using the terminal command `grep glyphicon . -r --exclude-dir=third_party`.



Discussion:
@raju249 -- want to try this one?

Thanks @seanlip I will try this one out.
But I guess I will have a quite many doubts  :sweat_smile: because I have not worked with linter before this but want to learn so this is my best shot
And also how can I change the glyphicon to material icons?

You'll need to look through the material icons catalog, and find stuff that matches the intent of the glyphicons, then do the replacement. There are lots of examples of the use of material icons in the codebase; these can be used as a basis.

Awesome @seanlip 
Is the catalogue available online or we have it in our codebase?

Online. Do a google search for 'material icons'.

Cool :+1: 
@seanlip Any reference for which files to work on ? :sweat_smile: 
It would just save some time 

You said just 10 of them are remaining 

Please take a look at the original comment on this thread -- the instructions to find those 10 instances are in there!

Yes

@seanlip Should I use Google Web Fonts to include Material Icons or are they already included?

They're already included. See header_css_libs.html.

Also, when you change things to use material-icons, please try and follow the way it's done elsewhere in the codebase, for consistency. Thanks!

Yes sure @seanlip 
Thanks!

Hi @seanlip 
`./core/templates/dev/head/css/oppia.css`

Only the class in the above file remains.
`skipBtn`  class. Should I remove the class?

Its used here
`./core/tests/protractor_utils/editor.js`


Resolving patch:
diff --git a/scripts/pre_commit_linter.py b/scripts/pre_commit_linter.py
--- a/scripts/pre_commit_linter.py
+++ b/scripts/pre_commit_linter.py
@@ -86,6 +86,10 @@
         'excluded_files': ()},
     '\r': {
         'message': 'Please make sure all files only have LF endings (no CRLF).',
+        'excluded_files': ()},
+    'glyphicon': {
+        'message': 'Please use equivalent material-icons '
+                   'instead of glyphicons.',
         'excluded_files': ()}
 }
 


Test patch:
Repository: oppia/oppia

Issue:
Add a Caption to an Image
When adding an image to an exploration, the user needs the ability to add a caption.

cc @AllanYangZhou 



Discussion:
I would be interested in taking this on? Not sure if @AllanYangZhou is already assigned, but I'd be willing to give it a shot. If not this issue, then perhaps #1556.

Nope -- @AllanYangZhou is point of contact, and this issue is still open. Assigned you!

My initial idea was to add a caption input box, similar to the alt text box, to capture the caption, and then display in a figcaption tag. Is this sufficient? @AllanYangZhou Or were you thinking something else.

Thanks!

@joshuacano That sounds like a good idea!


Resolving patch:
diff --git a/extensions/rich_text_components/Image/Image.py b/extensions/rich_text_components/Image/Image.py
--- a/extensions/rich_text_components/Image/Image.py
+++ b/extensions/rich_text_components/Image/Image.py
@@ -38,6 +38,13 @@ class Image(base.BaseRichTextComponent):
             'obj_type': 'Filepath',
         },
         'default_value': '',
+    }, {
+        'name': 'caption',
+        'description': ('Caption for image (optional)'),
+        'schema': {
+            'type': 'unicode',
+        },
+        'default_value': '',
     }, {
         'name': 'alt',
         'description': 'Alternative text (for screen readers)',


Test patch:
Repository: oppia/oppia

Issue:
Remove "View All" button and link for featured explorations carousel in library page
This is a follow on to the discussion in #1839.

Currently, in the library page, the featured explorations category has a "View All" button. Clicking on that button or on "Featured Explorations" will take the user to a url: `/search/find?q=` which will then show all the explorations in the gallery. Instead, the "View All" button should not appear for the featured category, and the link should also not be active. 



Discussion:
Assigning @devndub. 

Hi @devndub, how's this going? 

What does link not active mean?

It means that the "Featured Explorations" header should not be a link, and that nothing should happen when clicking on it.

Any updates on this?

(De-assigning @devndub due to lack of response.)

Could I work on this? 

Any ideas on how to test this? When I reload all explorations including the collections I am not able to see the featured activities header? What can I do to get the featured activities results?

Ah yes, this is a little involved.
1. Go to the admin page, and add your username to the list of moderator ids.
2. Go to the moderator page, and from there you can choose which activities to feature.

Thanks! Got it


Resolving patch:
diff --git a/core/controllers/library.py b/core/controllers/library.py
--- a/core/controllers/library.py
+++ b/core/controllers/library.py
@@ -117,18 +117,21 @@ def get(self):
                 'activity_summary_dicts': recently_published_summary_dicts,
                 'categories': [],
                 'header': feconf.LIBRARY_CATEGORY_RECENTLY_PUBLISHED,
+                'has_full_results_page': True,
             })
         if top_rated_activity_summary_dicts:
             summary_dicts_by_category.insert(0, {
                 'activity_summary_dicts': top_rated_activity_summary_dicts,
                 'categories': [],
                 'header': feconf.LIBRARY_CATEGORY_TOP_RATED_EXPLORATIONS,
+                'has_full_results_page': True,
             })
         if featured_activity_summary_dicts:
             summary_dicts_by_category.insert(0, {
                 'activity_summary_dicts': featured_activity_summary_dicts,
                 'categories': [],
                 'header': feconf.LIBRARY_CATEGORY_FEATURED_ACTIVITIES,
+                'has_full_results_page': False,
             })
 
         self.values.update({
diff --git a/core/domain/summary_services.py b/core/domain/summary_services.py
--- a/core/domain/summary_services.py
+++ b/core/domain/summary_services.py
@@ -343,6 +343,7 @@ def _generate_query(categories):
             'header': group['header'],
             'categories': group['search_categories'],
             'activity_summary_dicts': summary_dicts,
+            'has_full_results_page': True,
         })
 
     return results


Test patch: