From a8d0bafc9eca88bd89204bb04d40846e89db2b01 Mon Sep 17 00:00:00 2001 From: Piotr Mitros Date: Sun, 25 Dec 2011 17:59:31 -0500 Subject: [PATCH] Show answer appears to work --- problem.html | 3 +++ problem.js | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/problem.html b/problem.html index 6196f7998c..6e003ca7c0 100644 --- a/problem.html +++ b/problem.html @@ -9,3 +9,6 @@ % if save_button: % endif +% if answer_available: + +% endif diff --git a/problem.js b/problem.js index f72d5b6276..f003d0cd82 100644 --- a/problem.js +++ b/problem.js @@ -22,6 +22,13 @@ function ${ id }_load() { }); } }); + $('#show_${ id }').click(function() { + $.getJSON('/modx/problem/${ id }/problem_show', function(data) { + for (var key in data) { + $("#answer_${ id }_"+key).text(data[key]); + } + }); + }); $('#save_${ id }').click(function() { var submit_data={}; $.each($("[id^=input_${ id }_]"), function(index,value){