Doubt about HTML / JS [closed]

-3

I am developing a web platform for creating specific questionnaires. For now, I just want to read the question statement and the list of answer alternatives, depending on the type of question. I have the following form:

Iwantedtomakealittlebitoffun,sothatwhilethepersoniswritinginthefield"Enunciado", the speech bubble of the character on the right side is filled with what the person is typing in the field.

Does anyone have any ideas to help me?

  • Extra: Ending this part of Front End, I need to do some processing with this data. I already researched a bit about Back-End development, use of AJAX, etc. If someone can recommend me some framework to help with this connection or something, give a light on how to proceed to integrate the Back-End with what is already done, welcome.

Edit1: I just noticed that I can only click on the "Quiz title" text field to enter text. In the others, "Statement" and "Attributes" I can not click to enter text. No typing "pointer" appears when you click the mouse. Here is the code (there are some incomplete angularjs things that I was testing, just ignore them).

<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>TODO supply a title</title>
        <link href="css/bootstrap.min.css" rel="stylesheet">
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script></head><body><divng-app="meuApp" ng-controller="principalCtrl">


            <div class="container">
                <div class="col-md-8 col-md-offset-2">
                    <div class="panel with-nav-tabs panel-default">
                        <div class="panel-heading">
                            <div class ="center-block">
                                <div class="form-group">
                                    <label for="tituloQ">Título do questionário:</label>
                                    <input type="text" ng-model="tituloQue" name="tituloQ" id="tituloQ"/>
                                    <hr>

                                    <h1>Hello {{tituloQue}}!</h1>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>


            <div class="container">
                <div class="col-md-8 col-md-offset-2">
                    <div class="panel with-nav-tabs panel-default">
                        <div class="panel-heading">
                            <div class ="center-block">
                                <ul class="nav nav-tabs nav-justified" role="tablist">
                                    <li class="dropdown">
                                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">Criar pergunta
                                            <span class="caret"></span></a>
                                        <ul class="dropdown-menu ">
                                            <li><a href="#tab_PA" data-toggle="tab">  Criar pergunta texto livre</a></li>
                                            <li><a href="#tab_PME" data-toggle="tab"> Criar pergunta multipla escolha</a></li>
                                            <li><a href="#tab_PEU" data-toggle="tab">  Criar pergunta escolha única</a></li> 
                                        </ul>
                                    </li>                           
                                    <li role="presentation"><a href="#tab_T" aria-controls="tab_T" role="tab" data-toggle="tab">Temas</a></li>
                                    <li role="presentation"><a href="#tab_P" aria-controls="tab_P" role="tab" data-toggle="tab">Pré-Visualizar</a></li>
                                </ul>
                            </div>
                        </div>


                        <div class="panel-body">

                            <div class="row">
                                <div class="tab-content col-md-6" > 

                                    <div role="tabpanel" class="tab-pane" id="tab_T">
                                        Temas
                                    </div>

                                    <div role="tabpanel" class="tab-pane" id="tab_P">
                                        Pré-visualização
                                    </div>




                                    <div role="tabpanel" class="tab-pane active" id="tab_PA">

                                        <div class="form-group">


                                            <div class="form-group">
                                                <label>Enunciado:</label>
                                                <input type="text" ng-model="enunciadoPA">
                                                <br>
                                                <h1>Hello {{enunciadoPA}}!</h1>
                                            </div>

                                            <div class="row">
                                                <div class="form-group">
                                                    <label for="atributoPA">Atributos:</label><br>
                                                    <input type="text" name="atributoPA" id="atributoPA"> <br>
                                                    <small id="emailHelp" class="text-muted">Separe os atributos com traço, ' - '.</small>
                                                </div>
                                            </div>

                                            <input type="submit" name="addP" value="Adicionar Pergunta">
                                        </div>
                                    </div>


                                    <div role="tabpanel" class="tab-pane" id="tab_PME">

                                        <div class="form-group">
                                            <label for="enunciadoPME">Enunciado:</label><br>
                                            <input type="text" name="enunciadoPME" id="enunciadoPME">
                                        </div>

                                        <div class="form-group">
                                            <label for="atributoPME">Atributos:</label><br>
                                            <input type="text" name="atributoPME" id="atributoPME"> <br>
                                            <small id="emailHelp1" class="text-muted">Separe os atributos com traço, ' - '.</small>
                                        </div>

                                        <div class="form-group">
                                            <label for="opcoesPME">Grupo de opções:</label><br>
                                            <input type="text" name="opcoesPME" id="opcoesPME"> <br>
                                            <small id="emailHelp2" class="text-muted">Separe as opções de resposta com traço, ' - '.</small>
                                        </div>

                                        <input type="submit" name="addP" value="Adicionar Pergunta">
                                    </div>

                                    <div role="tabpanel" class="tab-pane" id="tab_EU">
                                        <form action="/efetivar.php" method="POST">

                                            <div class="form-group">
                                                <label for="enunciadoPEU">Enunciado:</label><br>
                                                <input type="text" name="enunciadoPEU" id="enunciadoPEU">
                                            </div>

                                            <div class="form-group">
                                                <label for="atributoPEU">Atributos:</label><br>
                                                <input type="text" name="atributoPEU" id="atributoPEU"> <br>
                                                <small id="emailHelp3" class="text-muted">Separe os atributos com traço, ' - '.</small>
                                            </div>

                                            <div class="form-group">
                                                <label for="opcoesPEU">Grupo de opções:</label><br>
                                                <input type="text" name="opcoesPEU" id="opcoesPEU"> <br>
                                                <small id="emailHelp3" class="text-muted">Separe as opções de resposta com traço, ' - '.</small>
                                            </div>

                                            <input type="submit" name="addP" value="Adicionar Pergunta">


                                        </form>
                                    </div>


                                </div>
                                <div class="col-md-6 text-center">
                                    <img src="imagens/feliz.png" width="350" height="280" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- SCRIPTS/BIBLIOTECAS -->
            <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
            <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script><!--SCRIPTSANGULARJS--><scriptsrc="js/app.js"></script> 
            <script src="js/controller.js"></script>

        </div>

    </body>
</html>
    
asked by anonymous 17.10.2017 / 23:04

1 answer

3

You can use AngularJS in this case. You can easily do this by first adding the angular.min.js in your HTML. A basic example that is already displayed in the angularjs home page , which meets your need:

<!doctype html>
<html ng-app>
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.6/angular.min.js"></script></head><body><div><label>Name:</label><inputtype="text" ng-model="yourName" placeholder="Enter a name here">
      <hr>
      <h1>Hello {{yourName}}!</h1>
    </div>
  </body>
</html>

A good backend framework I recommend is Django. A very simple to use Python framework that is very easy to install. There is already much of the documentation in Portuguese: link

    
18.10.2017 / 02:38