FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update: Add JSDoc to question and items model layer (fixes #853) by joe-replin · Pull Request #863 · adaptlearning/adapt-contrib-core · GitHub

Repository navigation

Update: Add JSDoc to question and items model layer (fixes #853) - #863

Merged
oliverfoster merged 2 commits into
masterfrom
issue/853
Oct 7, 2026
Merged

oliverfoster merged 2 commits into
masterfrom
issue/853

Conversation

Copy link
Copy Markdown
Contributor

Fixes #853

Update

  • questionModel.js — added @file/@module header, @class block, 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 names
  • itemModel.js — added @file/@module header, @class block, and JSDoc for toggleClass, toggleActive, and toggleVisited; fixed pre-existing @param name {type} tag order to standard @param {type} name
  • itemsComponentModel.js — added @file/@module header, @class block, and JSDoc for restoreUserAnswers, storeUserAnswer, getItem, and setActiveItem
  • itemsQuestionModel.js — added @file/@module header, @class block, and JSDoc for restoreUserAnswers, setupRandomisation, storeUserAnswer, isCorrect, getFeedback, score, maxScore, minScore, getInteractionObject, getResponse, getResponseType, getCorrectAnswerAsText, and getUserAnswerAsText; fixed two malformed /**\n * JSDoc blocks

Testing

  1. Run grunt build and verify no JS errors
  2. Open a course with an MCQ component; confirm question submits, marks, and resets correctly

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).
Clean up model documentation by removing stale "Known Issues" notes, fixing JSDoc link syntax for related models and enums, and adding clearer API comments around question setup, submission state, completion checks, and item reset behavior.
oliverfoster merged commit 4f43102 into master Oct 7, 2026
oliverfoster deleted the issue/853 branch October 7, 2026 08:13
github-actions Bot pushed a commit that referenced this pull request Oct 7, 2026
# [6.81.0](v6.80.0...v6.81.0) (2026-10-07)

### Update

* Add JSDoc documentation to content model hierarchy (fixes #852) (#862) ([806c56a](806c56a)), closes [#852](#852) [#862](#862)
* Add JSDoc to question and items model layer (fixes #853) (#863) ([4f43102](4f43102)), closes [#853](#853) [#863](#863)

Copy link
Copy Markdown
Member

🎉 This PR is included in version 6.81.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSDocs - Component Models

2 participants


Back | FazBrowse Home | New Git URL