| {% extends "experimentpage.html" %} |
| |
| {% block content %} |
| |
| <h1>Add Experiment</h1> |
| |
| <form method="POST" action="{% url 'exp_portal:add_exp' %}"> |
| <div class="form-group"> |
| <label for="id_exp_name">Experiment Name</label> |
| <input class="form-control" name="exp_name" id='id_exp_name' value="{{ experiment.name }}" size="60" required/> |
| </div> |
| <div class="form-group"> |
| <label for="id_exp_taskcount">Task Count</label> |
| <input class="form-control" name="exp_taskcount" id="id_exp_taskcount" value="{{ experiment.task_count }}" size="60" required/> |
| </div> |
| <div class="form-group"> |
| <label for="id_exp_tasklength">Task Length (mins)</label> |
| <input class="form-control" name="exp_tasklength" id="id_exp_tasklength" value="{{ experiment.task_length }}" size="60" required/> |
| </div> |
| <div class="checkbox"> |
| <input type="checkbox" name="exp_achievements" id="id_exp_achievements" {% if experiment.has_achievements %}checked{% endif %}/> |
| <label>Achievements</label> |
| </div> |
| <div class="checkbox"> |
| <input type="checkbox" name="exp_intake" id="id_exp_intake" {% if experiment.has_intake %}checked{% endif %}/> |
| <label>Intake Survey Online</label> |
| <br/> |
| <input class="form-control" name="exp_intake_url" id='id_exp_intake_url' value="{{ experiment.intake_url }}" size="255"/> |
| </div> |
| <div class="checkbox"> |
| <input type="checkbox" name="exp_followup" id="id_exp_followup" {% if experiment.has_followup %}checked{% endif %}/> |
| <label>Post Task Survey Online</label> |
| </div> |
| <div class="checkbox"> |
| <input type="checkbox" name="exp_consent" id="id_exp_consent" {% if experiment.consent %}checked{% endif %}/> |
| <label>Consent Online</label> |
| </div> |
| <div class="checkbox"> |
| <input type="checkbox" name="exp_sequentialtasks" id="id_exp_sequentialtasks" {% if experiment.sequential_tasks %}checked{% endif %}/> |
| <label for="exp_sequentialtasks" id="id_exp_st">Sequential Tasks (unchecked will open all tasks)</label> |
| </div> |
| <div class="checkbox"> |
| <input type="checkbox" name="exp_progress" id="id_exp_progress" {% if experiment.show_progress %}checked{% endif %}/> |
| <label>Show Progress Bar</label> |
| </div> |
| <div class="checkbox"> |
| <input type="checkbox" name="exp_timed" id="id_exp_timed" {% if experiment.timed %}checked{% endif %}/> |
| <label>Timed Tasks</label> |
| </div> |
| <button class="btn btn-primary" type="submit">Save Changes</button> |
| {% csrf_token %} |
| </form> |
| |
| <script> |
| |
| // intake survey URL code to hide/show the field |
| var cb = document.getElementById('id_exp_intake'); |
| cb.addEventListener('click', toggleExpIntakeField ); |
| function toggleExpIntakeField() { |
| var cb = document.getElementById('id_exp_intake'); |
| var textfield = document.getElementById('id_exp_intake_url'); |
| if (cb.checked) { |
| textfield.style.display = 'block'; |
| } else { |
| textfield.style.display = 'none'; |
| } |
| } |
| toggleExpIntakeField(); // do it once immediately |
| |
| </script> |
| |
| {% endblock %} |