From 58c46616073d1b99aaea9d0d51ebe772810db44d Mon Sep 17 00:00:00 2001 From: Derek Montgomery Date: Fri, 29 Jul 2016 15:24:10 -0500 Subject: [PATCH] dynamically load question ID --- app/assets/javascripts/live-coder.js | 2 +- app/views/candidate/question.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/live-coder.js b/app/assets/javascripts/live-coder.js index 2616bd4..aed1f8b 100644 --- a/app/assets/javascripts/live-coder.js +++ b/app/assets/javascripts/live-coder.js @@ -113,7 +113,7 @@ $(function(){ }); // If JavaScript is enabled, display the livecoder section dynamically - var qid = 257208768; + var qid = $('form#answer-form').data('qid'); $("[data-id='live-coder-answer']").load("/live-coder-entry/" + qid, function(){ // if it loads in, and hide "finish later" checkbox $("[data-id='live-coder-finish-later']").addClass("hidden"); diff --git a/app/views/candidate/question.html.erb b/app/views/candidate/question.html.erb index 1c935a6..595259e 100644 --- a/app/views/candidate/question.html.erb +++ b/app/views/candidate/question.html.erb @@ -5,7 +5,7 @@ content_for :footer_title, "Skills Assessment" %> -<%= form_tag(post_question_path) do %> +<%= form_tag post_question_path, id: 'answer-form', data: {qid: @question.question_id} do %>

<%= @question.question %>