Class: Faq

mathex. Faq

Stores an array containing all the faq items

new Faq(items) → {Object}

FAQ - Faq Class

Parameters:
Name Type Description
items Array The array describing all items. Each item is an object with properties:
  • question: string. The question, can contain mathjax math inside the tag {% LATEX MATH HERE %}
  • answer: string. The answer, can contain mathjax math inside the tag {% LATEX MATH HERE %}, and links to other faqs, whether indexed faqs or not (in this case showing the linked one in a layer): {{link_text:3}} or {{link_text:3:layer}}
  • audio: object. The audio object for the question and answer, it has the 'mp3' and 'ogg' properties storing the files' paths
Source:
Returns:
mathex.Faq instance
Type
Object
Example
 var faq = new mathex.Faq([
   {
     question: "Which color is yellow?",
        answer: 'yellow!',
        audio: {
          mp3: 'audio/myfile.mp3',
          ogg: 'audio/myfile.ogg',
     }
   },
   {
     question: "How much it is {% 1 + 1 %}?",
     answer: "<p>TWO!</p>"
   }
 ]);