Skip to content

Commit

Permalink
refactor question module; convert old format to new
Browse files Browse the repository at this point in the history
  • Loading branch information
davidxuan committed Apr 7, 2019
1 parent d7d2eff commit 44818fe
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion post.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,30 @@ into the {body} of the default.hbs template --}}
$("#more").show();
});
var questions = document.getElementById("question_container").getElementsByClassName("question");
var questions = document.getElementsByClassName("container");
for (i = 0; i < questions.length; i++) {
var locked_msg_div = document.createElement('div');
locked_msg_div.id = 'locked_msg';
locked_msg_div.setAttribute("style", "text-align: center; font-weight: bold");
var hidden_div = document.createElement('div');
hidden_div.id = 'hidden';
hidden_div.setAttribute("style", "display: none");
while (questions[i].childNodes.length > 0) {
hidden_div.appendChild(questions[i].childNodes[0]);
}
progress_div = document.createElement('div');
progress_div.id = 'progress';
progress_div.setAttribute('style', 'text-align: right');
hidden_div.appendChild(progress_div);
questions[i].appendChild(locked_msg_div);
questions[i].appendChild(hidden_div);
}
// last question to show
var show = 0;
var attemps = 0;
Expand Down

0 comments on commit 44818fe

Please sign in to comment.