How to pass an HTML tag inside a Javascript

Asked

Viewed 53 times

1

I’m trying to perform a mathematical activity on Moodle using Ardora as the creator of the activities. It does the javascript, css and html part by me, so the language activities are "simple". My problem is in activities with mathematics, because I need to pass formulas through the parameters and make the proper comparisons (question and answer) to see if the student was correct or not.

I have the files, already located where I have to change, but I’m not getting (or knowing) what and how to change.

Let me give you an example of what the activity should be

Questions: Answers: Kitty dog Gato Chovinista Porco Max

On the one hand, I have the column with the questions and on the other, the answers, in which the students must drag to the proper fields and make associations. For example, Max should go with Dog, Kitty with Cat and Chauvinist with Pig.

I have to do the same thing, but pulling mathematical formulas, example:

1 + 2 = 5 1 / 2 = 0,5 5 * 1 = 3

In this type of example, as I did not use formulas, it is easy to do. Now when I have to use mathematical expressions, I have to be able to put this on the screen in the format of the formulas (I tried to play a js that formats tex in html), and nothing.

I wanted to do something like this:

ax^2 + bx + c = 0
srqt(8)
\frac(8)\(1)

Can you help me? If you need more details I’ll pass. If it’s not clear the explanation or the problem, I try to improve the writing.

  • 1

    Hello Eriberto, welcome to the SOPT. I edited the text and the title slightly, removing the greetings and the thanks, and put the expression divided into lines, in code formatting, because I think it explains better what you want to do... You can reverse the editing or edit over something that does not agree with the editing. About the question, I didn’t understand very well what you want to do, but to write the code I think it would be possible to do with the tags preand code... but I’m not sure... check this out: http://www.w3schools.com/tags/tag_pre.asp and http://www.w3schools.com/TAgs/tag_code.asp

  • 1

    Thanks. I am a forum user in general, but this I am new. :)

  • Cool. SOPT is not exactly a forum, but it’s very useful... if you haven’t seen it, then take a look at the [tour]... Hugs.

  • 1

    Hi. I only saw the question today (sorry). But I still don’t understand your difficulty/need. What exactly do you need to do? What does "being able to put this on the screen" mean? It’s very confusing, and I didn’t see the relevance of Latex in this question.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.