Skip to content

Commit

Permalink
Added feedback to cia quiz
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxGeldner authored and nbaars committed Mar 26, 2019
1 parent 61d8051 commit 1cfd8dd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
26 changes: 14 additions & 12 deletions webgoat-lessons/cia/src/main/resources/html/CIA.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,21 @@
<script th:src="@{/lesson_js/quiz.js}" language="JavaScript"></script>
<link rel="import" type="application/json" th:href="@{/lesson_js/questions.json}"/>
<div class="adoc-content" th:replace="doc:CIA_quiz.adoc"></div>
<div class="assignment-success"><i class="fa fa-2 fa-check hidden" aria-hidden="true"></i></div>
<div class="container-fluid">
<form id="quiz-form" class="attack-form" accept-charset="UNKNOWN"
method="POST" name="form"
action="cia/quiz"
enctype="application/json;charset=UTF-8" role="form">
<div id="q_container"></div>
<br />
<input name="Quiz_solutions" value="Submit answers" type="SUBMIT"/>
</form>
<div class="attack-container">
<div class="assignment-success"><i class="fa fa-2 fa-check hidden" aria-hidden="true"></i></div>
<div class="container-fluid">
<form id="quiz-form" class="attack-form" accept-charset="UNKNOWN"
method="POST" name="form"
action="cia/quiz"
enctype="application/json;charset=UTF-8" role="form">
<div id="q_container"></div>
<br />
<input name="Quiz_solutions" value="Submit answers" type="SUBMIT"/>
</form>
</div>
<div class="attack-feedback"></div>
<div class="attack-output"></div>
</div>
<div class="attack-feedback"></div>
<div class="attack-output"></div>
</div>

</html>
2 changes: 1 addition & 1 deletion webgoat-lessons/cia/src/main/resources/js/quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $(function () {
let html = "";
jQuery.each(questionsObj, function(i, obj) {
jQuery.each(obj, function(j, quest) {
html += "<div id='question_" + j + "' class='quiz_question attack-container' name='question'><p>" + (j+1) + ".&nbsp;" + quest.text + "</p>";
html += "<div id='question_" + j + "' class='quiz_question' name='question' style='border: solid 1px; padding: 4px; margin: 5px 2px 5px 2px'><p>" + (j+1) + ".&nbsp;" + quest.text + "</p>";
html += "<fieldset>";
jQuery.each(quest.solutions, function(k, solution) {
solution = "Solution " + k + ": " + solution;
Expand Down

0 comments on commit 1cfd8dd

Please sign in to comment.