latex stuff on maths
This commit is contained in:
parent
837387433a
commit
a7a8dc6aa6
29
node/app.js
29
node/app.js
@ -77,15 +77,24 @@ app.post("/maths/submit-topics", (req,res) => {
|
||||
console.log("Problem: ", problem)
|
||||
console.log("Solution: ", solution)
|
||||
|
||||
res.send(`${topic_str}<br/>
|
||||
${subtopic_str}<br/>
|
||||
res.send(`<!DOCTYPE html>
|
||||
<h1>${topic_str}</h1><br/>
|
||||
<h3>${subtopic_str}</h3><br/>
|
||||
${problem}
|
||||
<form action="/maths/answer" method="post">
|
||||
<input type="hidden" name="solution" value="${solution}">
|
||||
<input type="hidden" name="topic" value="${topic}">
|
||||
<input type="hidden" name="subtopic" value="${subtopic}">
|
||||
<button type="submit">Answer</button>
|
||||
</form>`)
|
||||
</form>
|
||||
<script>
|
||||
MathJax = {
|
||||
tex: {
|
||||
inlineMath: [['$', '$'], ['\\(', '\\)']]
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>`)
|
||||
});
|
||||
|
||||
app.post("/maths/answer", (req,res) => {
|
||||
@ -94,13 +103,23 @@ app.post("/maths/answer", (req,res) => {
|
||||
console.log(req.body.subtopic)
|
||||
let topic = Number(req.body.topic)
|
||||
let subtopic = validator.escape(req.body.subtopic)
|
||||
res.send(`${req.body.solution}
|
||||
res.send(`<!DOCTYPE html>
|
||||
<h1>Answer:</h1>
|
||||
${req.body.solution}
|
||||
<form action="/maths/submit-topics" method="post">
|
||||
<input type="hidden" name="topic" value="${topic}">
|
||||
<input type="hidden" name="subtopic" value="${subtopic}">
|
||||
<button type="submit">Next</button>
|
||||
</form>
|
||||
<button onclick="window.location.href='https://deadvey.com/maths'">Back</button>`)
|
||||
<button onclick="window.location.href='https://deadvey.com/maths'">Back</button>
|
||||
<script>
|
||||
MathJax = {
|
||||
tex: {
|
||||
inlineMath: [['$', '$'], ['\\(', '\\)']]
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>`)
|
||||
});
|
||||
|
||||
app.post("/board/submit-comment", (req,res) => {
|
||||
|
Loading…
Reference in New Issue
Block a user