-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProblem.js
More file actions
63 lines (47 loc) · 1.57 KB
/
Problem.js
File metadata and controls
63 lines (47 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
class Problem{
constructor(){
this.title;
this.subTitle;
this.markdown;
this.subText;
this.equation;
this.layout;
this.setMarkdown();
}
/**
* Returns the the problem's HTML for a reveal.js slide.
*/
generateHTML(){
return this.markdown;
}
generateHTMLNode(){
let node = document.createElement("SECTION");
//let att = document.createAttribute("data-markdown");
//node.setAttributeNode(att);
node.innerHTML = this.generateHTML();
return node;
}
draw(){
let rev = document.getElementById('slides');
let app = rev.appendChild( this.generateHTMLNode() );
//let rev = document.getElementById('slides');//.innerHTML += this.generateHTML() ;
//MathJax.Hub.Queue(["Typeset",MathJax.Hub,app]);
MathJax.Hub.Typeset();
console.log(rev);
}
setMarkdown(){
this.markdown = `<section data-markdown>
<textarea data-template>
### Sample Problem #1
###### This is a sample problem. Here would be the text for it. Imagine this is detailed text that is helping set the scene for a problem you are solving.
$$ \left( 1.5 \times 10^3 \right) \cdot \left( 4 \times 10^{-9} \right) = \; ? $$
* select choice a -> do what?
* slect chooixe x, do what?
* answer f(n), do what?
* feedback per answer
* link to lessons
</textarea>
</section>`;
console.log(this.markdown);
}
}