123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676 |
- <?php
-
- // Description: EXTRACT QUESTIONNAIRE ID, AND IF VALID, DISPLAY ITS INFO
-
- require_once 'processes/config.php';
- require_once 'processes/dbh.inc.php';
- require_once 'processes/checkLogin.php';
-
- // IF VIEW VARIABLE NOT GIVEN, EXIT
- if(!isset($_GET['view'])) {
- exit();
- }
-
- // WARNING: CHANGE QUERY TO INCLUDE "`id_researcher` = '".$dbUserData['id_researcher']."';"
- $questionnaireID = mysqli_real_escape_string($connection, trim($_GET['view']));
- $query1 = "SELECT * FROM questionnair WHERE id = '$questionnaireID';";
- $result1 = mysqli_query($connection, $query1) or die("Error: ".mysqli_error($connection));
- $row1 = mysqli_fetch_array($result1);
-
- // IF QUESTIONNAIRE NOT IN DATABASE, EXIT
- if($result1->num_rows !== 1) {
- exit();
- }
-
- // EXTRACT & DISPLAY THE NUMBER OF QUESTIONS IN THE QUESTIONNAIRE
- $queryNumQuestions = "SELECT * FROM question WHERE id IN (SELECT id_question FROM questionnair_question WHERE id_questionnair = '$questionnaireID');";
- $resultNumQuestions = mysqli_query($connection, $queryNumQuestions);
- $numQuestions = $resultNumQuestions->num_rows;
-
- include_once 'header.php';
-
- ?>
-
- <!-- START OF viewQuestionnaire.php -->
- <body>
-
- <header id="main-header">
- <a id="logo" href=".">
- TANIA
- <img src="./img/pen_800x800.png" alt="tania logo pen" width="25" height="25">
- </a>
- <div id="account">
- <a class="nav-link" href="./questionnaires.php">Questionnaire Collection</a>
- <a class="sign-out" href="./processes/logout.php">Sign Out</a>
- </div>
- </header>
-
- <div class="container" style="margin-top: 8rem; min-height: calc(100vh - 8rem - 10vh);">
-
- <div class="row">
- <div class="col-sm-8">
- <h2>Questionnaire</h2>
- <p><font size="4"><b> Title: </b> <?php echo $row1['q_title']; ?></font></p>
- <p><font size="4"><b> Description: </b> <?php echo $row1['description']; ?></font></p>
- <p><font size="4"><b> Amount of Questions: </b> <?php echo $numQuestions; ?></font></p>
- </div>
- <div class="col-sm-4">
- <div class="hidden-xs">
- <br><br><br>
- </div>
- <div id="view-experience-buttons" style="max-width: 18rem;">
- <div data-toggle="tooltip" data-placement="top" title="Create Question" id="experience-pen" onclick="nextModal('#AddQuestion')">
- <span class="fas fa-plus"></span>
- </div>
- <div data-toggle="tooltip" data-placement="top" title="Edit Questionnaire" id="experience-pen" onclick="nextModal('#Edit')">
- <span class="fas fa-pen"></span>
- </div>
- </div>
- </div>
- </div><!--row-->
-
- <br>
-
- <div class="row">
- <div class="col-sm-12">
- <?php if($numQuestions > 0): ?>
- <table class="table table-hover table-striped" id="tableEvaluations">
- <thead>
- <tr>
- <th><h4>#</h4></th>
- <th><h4>Question</h4></th>
- </tr>
- </thead>
- <tbody>
- <?php
-
- $query2 = "SELECT * FROM question WHERE id IN (SELECT id_question FROM questionnair_question WHERE id_questionnair = '$questionnaireID');";
- $result2 = mysqli_query($connection, $query2);
- $x = 1;
-
- while($row2 = mysqli_fetch_array($result2)):
-
- $queryMinText = "SELECT value FROM question_type WHERE label = 'min_texto' AND id_question = '" . $row2['id'] . "';";
- $resultMinText = mysqli_query($connection, $queryMinText);
- $rowMinText = mysqli_fetch_array($resultMinText);
-
- $queryMaxVal = "SELECT value FROM question_type WHERE label = 'max_val' AND id_question = '" . $row2['id'] . "';";
- $resultMaxVal = mysqli_query($connection, $queryMaxVal);
- $rowMaxVal = mysqli_fetch_array($resultMaxVal);
-
- $queryMaxText = "SELECT value FROM question_type WHERE label = 'max_texto' AND id_question = '" . $row2['id']. "';";
- $resultMaxText = mysqli_query($connection, $queryMaxText);
- $rowMaxText = mysqli_fetch_array($resultMaxText);
-
- ?>
- <tr style="cursor: pointer;" data-toggle="modal" data-target="#EditQuestion" data-question-number="<?php echo $x; ?>" data-questionnaire-id="<?php echo $questionnaireID; ?>" data-question-id="<?php echo $row2['id']; ?>" data-premise="<?php echo $row2['premise']; ?>" data-type="<?php echo $row2['id_type']; ?>" data-min_text="<?php echo $rowMinText['value']; ?>" data-max_val="<?php echo $rowMaxVal['value']; ?>" data-max_text="<?php echo $rowMaxText['value']; ?>" data-categoryid="<?php echo $row2['id_category']; ?>" data-subcategoryid="<?php echo $row2['id_subcategory']; ?>">
- <th><?php echo $x; ?></th>
- <td><p><?php echo $row2['premise']; ?></p></td>
- <!-- <td><button class='btn btn-danger btn-sm' data-toggle='modal' data-target='#Delete' data-questionnaire-id="<?php echo $questionnaireID; ?>" data-question-id="<?php echo $row2['id']; ?>" data-premise="<?php echo $row2['premise']; ?>">Delete</button></td> -->
- <!--<a class='btn btn-danger btn-sm' href='confirmDeleteQuestionQuestionnaire.php?del=<?php echo $row2['id']; ?>&quest=$id_questionnaire'>Delete</a>-->
- </tr>
- <?php $x++; endwhile; ?>
- </tbody>
- </table>
- <?php else: ?>
- <h3 class="text-center"><small>It seems you haven't added any questions to this questionnaire...</small></h3>
- <?php endif; ?>
- </div><!--col-->
- </div><!--row-->
-
- <br>
-
- <div class="row">
- <div class="col-sm-2 col-sm-offset-5">
- <div data-toggle="tooltip" data-placement="top" title="Create Question" id="experience-pen" onclick="nextModal('#AddQuestion')" style="padding: 0.5em; margin: 0 auto; width: 60px;">
- <span class="fas fa-plus"></span>
- </div>
- </div>
- </div>
-
- <br><br>
-
- </div><!--container-->
-
-
-
-
-
- <!-- POPUP FOR NEW QUESTION -->
- <form id="newQuestion">
- <div class='modal fade' id='AddQuestion' tabindex='-1' role='dialog' aria-labelledby='AddQuestionLabel' aria-hidden='true'>
- <div class='modal-dialog modal-lg' role='document'>
- <div class='modal-content'>
-
- <div class='modal-body'>
-
- <!-- CLOSE BUTTON -->
- <button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>×</span></button>
-
- <div class='row'>
- <div class='col-sm-10'>
- <h3>Add New Question</h3>
- </div>
- </div><!--row-->
-
- <hr>
-
-
- <!-- QUESTION -->
- <div id="q">
-
- <div class="row">
- <div class="col-sm-12 col-sm-offset-1">
- <h4>New Question</h4>
- </div>
- </div>
-
-
- <!-- QUESTIONNAIRE ID -->
- <input type="hidden" name="questionnaireID" value="<?php echo $questionnaireID; ?>">
-
-
- <div class="form-horizontal">
-
- <!-- PREMISE -->
- <div class="form-group">
- <label class='col-sm-offset-1 control-label col-sm-2'>Premise:</label>
- <div class='col-sm-8'>
- <input id="q_premise" type="text" class="form-control text-center" name="q_premise" placeholder="Premise" required>
- </div>
- </div>
-
- <!-- TYPE -->
- <div class="form-group">
- <label class='col-sm-offset-1 control-label col-sm-2'>Question Type:</label>
- <div class='col-sm-8'>
- <select class="form-control text-center" id="q_type" name="q_type" style="width:100%; text-align-last:center;" onchange="newThing(event)" required>
- <!-- <option disabled selected value="">Type</option> -->
- <option value="1">Scaled</option>
- <option value="2">Open Answer</option>
- </select>
- </div>
- </div>
-
- </div>
-
- <!-- MIN/MAX VALUES/TEXT (OPTIONAL) -->
- <div class="range">
- <div class="form-inline col col-sm-offset-2">
- <div class="form-group">
- <label class='control-label col-sm-2'>Min. Value:</label>
- <div class="col-sm-8">
- <input type="number" class="form-control text-center" id="min_val" name="min_val" value="1" readonly>
- </div>
- </div>
- <div class="form-group">
- <label class='control-label col-sm-2'>Min. Text:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control text-center" id="min_text" name="min_text" placeholder="Very Dissatisfied">
- </div>
- </div>
- </div>
-
- <div class="form-inline col col-sm-offset-2">
- <div class="form-group">
- <label class='control-label col-sm-2'>Max. Value:</label>
- <div class="col-sm-1">
- <input type="number" class="form-control text-center" id="max_val" name="max_val" value="5" min="2">
- </div>
- </div>
- <div class="form-group">
- <label class='control-label col-sm-2'>Max. Text:</label>
- <div class="col-sm-1">
- <input type="text" class="form-control text-center" id="max_text" name="max_text" placeholder="Very Satisfied">
- </div>
- </div>
- </div>
-
- <br>
-
- </div>
-
- <div class="form-horizontal">
-
- <!-- CORRESPONDING CATEGORY -->
- <div class="form-group">
- <label class='col-sm-offset-1 control-label col-sm-2'>Category:</label>
- <div class='col-sm-8'>
- <select class="form-control text-center" id="q_category" name="q_category" style="width: 100%; text-align-last:center;" required>
- <!-- <option disabled selected value="">Category</option> -->
- <?php
- $queryCategories = "SELECT * FROM category WHERE id IN (SELECT id_category FROM question WHERE id IN (SELECT id_question FROM questionnair_question WHERE id_questionnair = '$questionnaireID'));";
- $resultCategories = mysqli_query($connection, $queryCategories);
- while($rowCategories = mysqli_fetch_array($resultCategories)):
- ?>
- <option value="<?php echo $rowCategories['id']; ?>"><?php echo $rowCategories['categoria']; ?></option>
- <?php endwhile; ?>
- </select>
- </div>
- </div>
-
- <!-- CORRESPONDING SUBCATEGORY -->
- <div class="form-group">
- <label class='col-sm-offset-1 control-label col-sm-2'>Subcategory:</label>
- <div class='col-sm-8'>
- <select class="form-control text-center" id="q_subcategory" name="q_subcategory" style="width: 100%; text-align-last:center;" required>
- <!-- <option disabled selected value="">Subcategory</option> -->
- <?php
- $querySubcategories = "SELECT * FROM subcategory WHERE id IN (SELECT id_subcategory FROM question WHERE id IN (SELECT id_question FROM questionnair_question WHERE id_questionnair = '$questionnaireID'));";
- $resultSubcategories = mysqli_query($connection, $querySubcategories);
- while($rowSubcategories = mysqli_fetch_array($resultSubcategories)):
- ?>
- <option value="<?php echo $rowSubcategories['id']; ?>"><?php echo $rowSubcategories['subcategoria']; ?></option>
- <?php endwhile; ?>
- </select>
- </div>
- </div>
-
- </div>
-
- </div>
-
-
- <br>
-
-
- <!-- ERROR ALERT FOR USER -->
- <div id="error-newQuestion" class="row" style="display: none;">
- <div class="col-sm-12">
- <div class="alert alert-danger mb-1" role="alert">
- <h4 class="error-lead">Error!</h4>
- <p class="error-description"></p>
- </div>
- </div>
- </div>
-
-
- </div><!--modal-body-->
-
- <!-- SUBMIT OR PREVIOUS -->
- <div class='modal-footer'>
- <button type='button' class='btn btn-default' data-dismiss='modal'>Cancel</button>
- <button type="submit" class='btn btn-primary' name='insertQuestionToQuestionnaire'>Add</button>
- </div>
-
- </div><!--modal-content-->
- </div><!--modal-dialog-->
- </div><!--modal-->
- </form>
-
-
-
-
-
-
-
- <!-- POPUP FOR EDIT QUESTIONNAIRE -->
- <form id="updateQuestionnaire" class="form-horizontal">
- <div class='modal fade' id='Edit' tabindex='-1' role='dialog' aria-labelledby='EditLabel' aria-hidden='true'>
- <div class='modal-dialog' role='document'>
- <div class='modal-content'>
-
- <div class='modal-header'>
- <h3 class='modal-title' id='EditLabel'>Edit Questionnaire<button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>×</span></button></h3>
- </div>
-
- <div class='modal-body'>
-
-
-
- <!-- QUESTIONNAIRE ID -->
- <input type='hidden' name='questionnaireID' value='<?php echo $questionnaireID; ?>'>
-
- <!-- TITLE -->
- <br>
- <div class='form-group'>
- <label class='col-sm-offset-1 control-label col-sm-2' for='newTitle'>Title:</label>
- <div class='col-sm-7'>
- <input type='text' class='form-control text-center' id='newTitle' name='newTitle' value='<?php echo $row1['q_title']; ?>'>
- </div>
- </div>
-
- <!-- DESCRIPTION -->
- <div class='form-group'>
- <label class='col-sm-offset-1 control-label col-sm-2' for='newDescription'>Description:</label>
- <div class='col-sm-7'>
- <textarea class='form-control text-center' id='newDescription' name='newDescription' rows='3' style='resize:vertical;'><?php echo $row1['description']; ?></textarea>
- </div>
- </div>
-
-
- <br>
-
-
- <!-- ERROR ALERT FOR USER -->
- <div id="error-updateQuestionnaire" class="row" style="display: none;">
- <div class="col-sm-12">
- <div class="alert alert-danger mb-1" role="alert">
- <h4 class="error-lead">Error!</h4>
- <p class="error-description"></p>
- </div>
- </div>
- </div>
-
-
-
- </div><!--modal-body-->
-
- <!-- SUBMIT OR CANCEL -->
- <div class='modal-footer'>
- <button type='button' class='btn btn-default' data-dismiss='modal'>Cancel</button>
- <button type='button' class='btn btn-danger' data-dismiss='modal' onclick="nextModal('#DeleteQuestionnaire')">Delete</button>
- <button type='submit' class='btn btn-primary' name='updateQuestionnaire'>Save Changes</button>
- </div>
-
- </div><!--modal-content-->
- </div><!--modal-dialog-->
- </div><!--modal-->
- </form>
-
-
-
-
-
- <!-- POPUP FOR DELETE QUESTIONNAIRE -->
- <form id="deleteQuestionnaire">
- <div class='modal fade' id='DeleteQuestionnaire' tabindex='-1' role='dialog' aria-labelledby='DeleteQuestionnaireLabel' aria-hidden='true'>
- <div class='modal-dialog modal-dialog-centered' role='document'>
- <div class='modal-content'>
-
- <div class='modal-header'>
- <h3 class='modal-title' id='DeleteQuestionnaireLabel'>Delete Question<button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>×</span></button></h3>
- </div>
-
- <div class='modal-body'>
-
-
-
- <!-- QUESTIONNAIRE ID -->
- <input type='hidden' name='questionnaireID' value="<?php echo $questionnaireID; ?>">
-
- <span class='text-center'>
- <h3>Are you sure you want to delete this Questionnaire?</h3>
- <!-- <h3 id="deletePremise" style='color:#ff8f00;'></h3> -->
- </span>
-
- <br>
- <p class='alert alert-warning text-justify'>This action will delete the questionnaire and all of its questions and moments. If you have any problems, contact technical support at: <a class='alert-link' href='#'>support@tania.uprrp.edu</a>.</p>
- <br>
- <!--You should be aware of this and opt to edit manually any affected moments and experiences in the following pages: <a class='alert-link' href='#'>experience</a>.-->
-
-
-
- <!-- ERROR ALERT FOR USER -->
- <div id="error-deleteQuestionnaire" class="row" style="display: none;">
- <div class="col-sm-12">
- <div class="alert alert-danger mb-1" role="alert">
- <h4 class="error-lead">Error!</h4>
- <p class="error-description"></p>
- </div>
- </div>
- </div>
-
-
-
- </div><!--modal-body-->
-
- <!-- SUBMIT OR CANCEL -->
- <div class='modal-footer'>
- <button type='button' class='btn btn-default' data-dismiss='modal'>Cancel</button>
- <button type='submit' class='btn btn-danger' name='deleteQuestionnaire'>Delete Anyway</button>
- </div>
-
- </div><!--modal-content-->
- </div><!--modal-dialog-->
- </div><!--modal-->
- </form>
-
-
-
-
-
- <!-- POPUP FOR EDIT QUESTION FROM QUESTIONNAIRE -->
- <form id="updateQuestion">
- <div class='modal fade' id='EditQuestion' tabindex='-1' role='dialog' aria-labelledby='EditQuestionLabel' aria-hidden='true'>
- <div class='modal-dialog modal-lg' role='document'>
- <div class='modal-content'>
-
- <div class='modal-header'>
- <h3 class='modal-title' id='EditQuestionLabel'>Edit Question<button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>×</span></button></h3>
- </div>
-
- <div class='modal-body'>
-
-
-
- <!-- QUESTIONNAIRE ID -->
- <!-- <input type='hidden' name='questionnaireID'> -->
-
- <!-- QUESTION ID -->
- <input type='hidden' name='questionID'>
-
- <br>
-
- <div class="row">
- <div class="col-sm-12 col-sm-offset-1">
- <h4>Question <span class="question-number"></span></h4>
- </div>
- </div>
-
- <div class="form-horizontal">
-
- <!-- PREMISE -->
- <div class="form-group">
- <label class='col-sm-offset-1 control-label col-sm-2'>Premise:</label>
- <div class='col-sm-8'>
- <input id="update_q_premise" type="text" class="form-control text-center" name="update_q_premise" placeholder="Premise" maxlength="600" required>
- </div>
- </div>
-
- <!-- TYPE -->
- <div class="form-group">
- <label class='col-sm-offset-1 control-label col-sm-2'>Question Type:</label>
- <div class='col-sm-8'>
- <select class="form-control text-center" id="update_q_type" name="update_q_type" style="width:100%; text-align-last:center;" onchange="newThing(event)" required>
- <!-- <option disabled selected value="">Type</option> -->
- <option value="1">Scaled</option>
- <option value="2">Open Answer</option>
- </select>
- </div>
- </div>
-
- </div>
-
- <!-- MIN/MAX VALUES/TEXT (OPTIONAL) -->
- <div class="range">
- <div class="form-inline col col-sm-offset-2">
- <div class="form-group">
- <label class='control-label col-sm-2'>Min. Value:</label>
- <div class="col-sm-8">
- <input type="number" class="form-control text-center" id="update_min_val" name="update_min_val" value="1" readonly>
- </div>
- </div>
- <div class="form-group">
- <label class='control-label col-sm-2'>Min. Text:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control text-center" id="update_min_text" name="update_min_text" maxlength="40" placeholder="Very Dissatisfied">
- </div>
- </div>
- </div>
-
- <div class="form-inline col col-sm-offset-2">
- <div class="form-group">
- <label class='control-label col-sm-2'>Max. Value:</label>
- <div class="col-sm-1">
- <input type="number" class="form-control text-center" id="update_max_val" name="update_max_val" value="5" min="2">
- </div>
- </div>
- <div class="form-group">
- <label class='control-label col-sm-2'>Max. Text:</label>
- <div class="col-sm-1">
- <input type="text" class="form-control text-center" id="update_max_text" name="update_max_text" maxlength="40" placeholder="Very Satisfied">
- </div>
- </div>
- </div>
-
- <br>
-
- </div>
-
- <div class="form-horizontal">
-
- <!-- CORRESPONDING CATEGORY -->
- <div class="form-group">
- <label class='col-sm-offset-1 control-label col-sm-2'>Category:</label>
- <div class='col-sm-8'>
- <select class="form-control text-center" id="update_q_category" name="update_q_category" style="width: 100%; text-align-last:center;" required>
- <!-- <option disabled selected value="">Category</option> -->
- <?php
- $queryCategories = "SELECT * FROM category WHERE id IN (SELECT id_category FROM question WHERE id IN (SELECT id_question FROM questionnair_question WHERE id_questionnair = '$questionnaireID'));";
- $resultCategories = mysqli_query($connection, $queryCategories);
- while($rowCategories = mysqli_fetch_array($resultCategories)):
- ?>
- <option value="<?php echo $rowCategories['id']; ?>"><?php echo $rowCategories['categoria']; ?></option>
- <?php endwhile; ?>
- </select>
- </div>
- </div>
-
- <!-- CORRESPONDING SUBCATEGORY -->
- <div class="form-group">
- <label class='col-sm-offset-1 control-label col-sm-2'>Subcategory:</label>
- <div class='col-sm-8'>
- <select class="form-control text-center" id="update_q_subcategory" name="update_q_subcategory" style="width: 100%; text-align-last:center;" required>
- <!-- <option disabled selected value="">Subcategory</option> -->
- <?php
- $querySubcategories = "SELECT * FROM subcategory WHERE id IN (SELECT id_subcategory FROM question WHERE id IN (SELECT id_question FROM questionnair_question WHERE id_questionnair = '$questionnaireID'));";
- $resultSubcategories = mysqli_query($connection, $querySubcategories);
- while($rowSubcategories = mysqli_fetch_array($resultSubcategories)):
- ?>
- <option value="<?php echo $rowSubcategories['id']; ?>"><?php echo $rowSubcategories['subcategoria']; ?></option>
- <?php endwhile; ?>
- </select>
- </div>
- </div>
-
- </div>
-
-
- <br>
-
- <!-- ERROR ALERT FOR USER -->
- <div id="error-updateQuestion" class="row" style="display: none;">
- <div class="col-sm-12">
- <div class="alert alert-danger mb-1" role="alert">
- <h4 class="error-lead">Error!</h4>
- <p class="error-description"></p>
- </div>
- </div>
- </div>
-
-
-
- </div><!--modal-body-->
-
- <!-- SUBMIT OR CANCEL -->
- <div class='modal-footer'>
- <button type='button' class='btn btn-default' data-dismiss='modal'>Cancel</button>
- <button type='button' class='btn btn-danger' data-dismiss='modal' onclick="nextModal('#Delete')">Delete</button>
- <button type='submit' class='btn btn-primary' name='updateQuestion'>Save Changes</button>
- </div>
-
- </div><!--modal-content-->
- </div><!--modal-dialog-->
- </div><!--modal-->
- </form>
-
-
-
-
-
-
- <!-- POPUP FOR DELETE QUESTION FROM QUESTIONNAIRE -->
- <form id="deleteQuestion" class='form-horizontal'>
- <div class='modal fade' id='Delete' tabindex='-1' role='dialog' aria-labelledby='DeleteLabel' aria-hidden='true'>
- <div class='modal-dialog modal-dialog-centered' role='document'>
- <div class='modal-content'>
-
- <div class='modal-header'>
- <h3 class='modal-title' id='DeleteLabel'>Delete Question<button type='button' class='close' data-dismiss='modal' aria-label='Close'><span aria-hidden='true'>×</span></button></h3>
- </div>
-
- <div class='modal-body'>
-
-
-
- <!-- QUESTION ID -->
- <input type='hidden' name='questionID'>
-
- <span class='text-center'>
- <h3>Are you sure you want to delete Question <span class="question-number"></span>?</h3>
- <!-- <h3 id="deletePremise" style='color:#ff8f00;'></h3> -->
- </span>
-
- <br>
- <p class='alert alert-warning text-justify'>This action will delete the question from this questionnaire (and from its moments). If you have any problems, contact technical support at: <a class='alert-link' href='#'>support@tania.uprrp.edu</a>.</p>
- <br>
- <!--You should be aware of this and opt to edit manually any affected moments and experiences in the following pages: <a class='alert-link' href='#'>experience</a>.-->
-
-
-
- <!-- ERROR ALERT FOR USER -->
- <div id="error-deleteQuestion" class="row" style="display: none;">
- <div class="col-sm-12">
- <div class="alert alert-danger mb-1" role="alert">
- <h4 class="error-lead">Error!</h4>
- <p class="error-description"></p>
- </div>
- </div>
- </div>
-
-
-
- </div><!--modal-body-->
-
- <!-- SUBMIT OR CANCEL -->
- <div class='modal-footer'>
- <button type='button' class='btn btn-default' data-dismiss='modal'>Cancel</button>
- <button type='submit' class='btn btn-danger' name='deleteQuestion'>Delete Anyway</button>
- </div>
-
- </div><!--modal-content-->
- </div><!--modal-dialog-->
- </div><!--modal-->
- </form>
-
-
-
-
-
-
-
- <script src="js/viewQuestionnaire.js"></script>
- <script src="js/handleSubmit.js"></script>
- <script src="js/editQuestion.js"></script>
-
- <script>
-
- ["updateQuestionnaire", "newQuestion", "updateQuestion", "deleteQuestionnaire", "deleteQuestion"].forEach(function(formName) {
-
- var form = document.getElementById(formName);
-
- if(form) {
- form.addEventListener('submit', function(e) {
- handleSubmit(e, formName);
- });
- }
-
- });
-
- </script>
-
-
- <!-- END OF viewQuestionnaire.php -->
-
- <?php include_once 'footer.php'; ?>
|