Update: Add JSDoc to question and items model layer (fixes #853)#863
Open
joe-replin wants to merge 1 commit into
Open
Update: Add JSDoc to question and items model layer (fixes #853)#863joe-replin wants to merge 1 commit into
joe-replin wants to merge 1 commit into
Conversation
Add comprehensive JSDoc headers and inline documentation across itemModel, itemsComponentModel, itemsQuestionModel, and questionModel. Document class responsibilities, public methods and return values (e.g. toggleClass, toggleActive/toggleVisited, restoreUserAnswers, storeUserAnswer, getItem, setActiveItem, setupRandomisation, getInteractionObject, getResponse/getResponseType), and note a few known issues/improvements. Enhance QuestionModel with clearer abstract method docs (canSubmit, isCorrect, isPartlyCorrect, getFeedback, getResponse, getResponseType), button state helper and small API clarifications. No functional behavioral changes beyond added return annotations and documentation, and a few minor API clarifications (toggleClass now documents chaining return).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #853
Update
questionModel.js— added@file/@moduleheader,@classblock, and JSDoc for all public methods (canSubmit,isCorrect,isPartlyCorrect,getFeedback,isInteractive,reset,resetQuestion,refresh,getButtonState,getInteractionObject,getResponse,getResponseType,onSubmitted,addContextActivity,addContentObjectContextActivities,contextActivities,score,maxScore,minScore,setScore); removed 13 redundant inline comments that restated method namesitemModel.js— added@file/@moduleheader,@classblock, and JSDoc fortoggleClass,toggleActive, andtoggleVisited; fixed pre-existing@param name {type}tag order to standard@param {type} nameitemsComponentModel.js— added@file/@moduleheader,@classblock, and JSDoc forrestoreUserAnswers,storeUserAnswer,getItem, andsetActiveItemitemsQuestionModel.js— added@file/@moduleheader,@classblock, and JSDoc forrestoreUserAnswers,setupRandomisation,storeUserAnswer,isCorrect,getFeedback,score,maxScore,minScore,getInteractionObject,getResponse,getResponseType,getCorrectAnswerAsText, andgetUserAnswerAsText; fixed two malformed/**\n *JSDoc blocksTesting
grunt buildand verify no JS errors