Help
Custom Questions

The BrainHoney exam engine renders many types of questions, including multiple choice, matching, and short answer. To present a question in a way that does not fit any of the predefined types, you implement a custom question. Custom questions can range in complexity from simple, formatting overrides of standard questions to complete, custom-question rendering and grading systems hosted on external servers.

To control the rendering of an entire assessment (as opposed to each individual question) see Adaptive Assessment API.

Custom questions have several rendering modes, which are shown below. Custom questions indicate which of these modes they control. In the simplest case, a custom question controls only one, usually the Active mode.

ModeDescription
ActiveThe user is currently taking the exam.
ReviewThe user is reviewing the answers and feedback from the exam.
PrintThe teacher is printing a paper copy of the exam.
PrintKeyThe teacher is printing a paper copy of the exam, with the correct answer key.
TemplateAn author is creating a new custom question of this type. This mode provides a question template for the new question.
Defining Custom Questions

You define a custom question with XML in the <custom> format. You can store it as a course resource or return it from a web service call on an externally hosted server. The XML lets you pick which question behaviors to customize. For example, you could provide a custom display for multiple-choice questions while still using standard, built-in scoring and reporting; or you could implement all aspects of the question, including rendering, grading, and printing. (See Advanced Assessment Editor for details about authoring custom questions.)

The <body> element in the custom XML contains the HTML and Javascript that renders the question, stores student answers, and optionally scores them. To retrieve and store data, it calls Custom Question Javascript API methods such as CQ.getInfo, CQ.setAnswer, and CQ.onBeforeSave.

Scoring Custom Questions

Custom questions can implement their own grading algorithm. For example you might develop a crossword-puzzle custom question that scores according to how many "across" and "down" answers are correct. Scoring can occur either in the client-side Javascript or on an external server via the Web Service API. In either case, the custom question Javascript stores student answers by calling CQ.setAnswer. The client-side scorer also specifies a score in that call. The web-service scorer returns the score in a Score Response.

If for any reason a custom question does not assign a score, the exam engine assumes the question is manually graded (like an essay question) and sends it to the teacher for grading.

Hosting External Custom Questions

To host questions on a web server other than BrainHoney, you implement the Custom Question Web Service API on your server. Because the web-service Request contains most question information, externally hosted custom questions typically do not call the CQ.getInfo Javascript method. However, they do still call CQ.setAnswer to store student reponses.

Note that BrainHoney ToGo end-users can use externally hosted, web-service questions only when they are online.

See Also
Advanced Assessment Editor <custom> Javascript API Web Service API