-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Implement editing of questions #5614
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #5614 +/- ##
===========================================
- Coverage 45.48% 45.47% -0.01%
===========================================
Files 517 518 +1
Lines 30372 30493 +121
Branches 4568 4576 +8
===========================================
+ Hits 13814 13867 +53
- Misses 16558 16626 +68
Continue to review full report at Codecov.
|
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.
Did a quick pass and left some comments.
|
||
Returns: | ||
list(QuestionSkillLinkModel). The list of question skill link | ||
domain objects that are linked to the question ID or an empty list |
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.
I don't think the domain objects for QuestionSkillLink are being returned currently. Can you change the returned object to be a list of QuestionSkillLink domain objects instead of datastore objects?
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.
done
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.
In that case, I think the docstring should also be changed to QuestionSkillLink, instead of QuestionSkillLinkModel?
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.
Pending comment?
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.
fixed
@@ -25,7 +25,7 @@ oppia.directive('questionEditor', [ | |||
getQuestionId: '&questionId', | |||
getMisconceptions: '&misconceptions', | |||
canEditQuestion: '&', | |||
questionStateData: '=' | |||
question: '=' |
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.
If you are doing this, might as well remove questionId above as well, and use the question object itself?
Also, did you change all instances of this directive to use this? I think this is used in creator_dashboard as well.
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.
done, can you check if the instance in the creator dashboard still functions properly? I can't seem to figure out how to test it. (I activated ENABLE_NEW_STRUCTURES and ENABLE_GENERALIZED_FEEDBACK_THREADS in constants.js but don't see anything)
Hi @aks681 , can you do another pass? |
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.
Did a full pass. Mostly minor comments.
|
||
Returns: | ||
list(QuestionSkillLinkModel). The list of question skill link | ||
domain objects that are linked to the question ID or an empty list |
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.
In that case, I think the docstring should also be changed to QuestionSkillLink, instead of QuestionSkillLinkModel?
core/storage/question/gae_models.py
Outdated
ID doesn't exist. | ||
""" | ||
return QuestionSkillLinkModel.query().filter( | ||
cls.question_id == question_id).fetch() |
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.
Shouldn't cls.deleted == false
be also checked?
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.
done
oppia.constant('CMD_UPDATE_QUESTION_PROPERTY', 'update_question_property'); | ||
|
||
oppia.factory('QuestionUpdateService', [ | ||
'QuestionObjectFactory', |
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.
I think 2 or 3 dependencies can be declared in a line?
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.
done
QUESTION_PROPERTY_LANGUAGE_CODE, | ||
QUESTION_PROPERTY_QUESTION_STATE_DATA, | ||
CMD_UPDATE_QUESTION_PROPERTY) { | ||
var _changeCount = 0; |
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.
I don't see this being incremented in this file, only reset seems to be there. Isn't this available from QuestionUndoRedoService?
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.
Yeah my bad, I forgot to remove those
EVENT_QUESTION_SUMMARIES_INITIALIZED, | ||
QuestionUndoRedoService, UrlService, | ||
UndoRedoService) { | ||
$scope.QuestionUndoRedoService = QuestionUndoRedoService; |
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.
Is this used in the HTML file? If not, no need to have it in $scope.
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 is used in the html file now
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.
Ok, but even then it only uses that single function. So, just surface that function to scope instead of the whole service.
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.
done
Hi @aks681 , can you do another pass? |
@tjiang11 Is there anything extra to do to test the question editor? I enabled the flag in constants.js. Went to Questions tab in topic editor, created a question and then clicked on it again, which opened the question editor with that question's details already filled. |
Hi @aks681 , the issue should be fixed, PTAL! |
UI LGTM! @seanlip can you do one last code review? I think it might be good to go. |
@@ -98,10 +98,56 @@ oppia.directive('stateInteractionEditor', [ | |||
interactionCustomizationArgs, false); | |||
}; | |||
|
|||
var _updateInteractionPreviewAndAnswerChoices = function() { |
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.
Could you reuse the logic in StateEditorService.getAnswerChoices()? Better than duplicating.
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.
done
Just one last issue with code duplication (I think). Otherwise looks good, thanks! |
Hi @tjiang11, I'm going to mark this PR as stale because it hasn't had any updates for 10 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue. |
…estion's interaction; Fix issue with not validating when no interaction is specified.
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.
Hi @tjiang11, I think you forgot to flip the flag back. Otherwise looks good, thanks!
assets/constants.js
Outdated
@@ -464,7 +464,7 @@ var constants = { | |||
"\\u001b", "\\u001c", "\\u001d", "\\u001e", "\\u001f" | |||
], | |||
|
|||
"ENABLE_NEW_STRUCTURES": false, | |||
"ENABLE_NEW_STRUCTURES": true, |
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.
This should be false, right?
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.
Will merge as soon as the above comment is addressed.
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.
Looks good, thanks!
Merging.
No description provided.