From 982522b5b9dfc39c10d08129b873aadf77b7293f Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Sun, 28 Feb 2016 19:40:37 +0100 Subject: Experiment: add "teacher helped" link to Prolog screen Records a {'typ': 'experiment', 'data': 'teacher help'} action when clicked. This will allow us to consider such traces specially when evaluating different hint types. This is specific to the prolog_hints experiment and should be reverted or generalized in the future. --- js/codeq/prolog.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'js/codeq') diff --git a/js/codeq/prolog.js b/js/codeq/prolog.js index 7cf9592..6e07784 100644 --- a/js/codeq/prolog.js +++ b/js/codeq/prolog.js @@ -28,6 +28,10 @@ along with this program. If not, see . */ jqAllButtons = jqBtnPlan.add(jqBtnTest), // all the buttons prologHandler; + // experiment: Prolog hints + var jqTeacherHelp = jqScreen.find('.teacher-help'); + // end of experiment: Prolog hints + var enterFun = function(problemDef, commonDef, currentSolution) { $('#navigation-problem-list').css('display', ''); var navigationProlog = $("#navigation-prolog"); @@ -55,6 +59,11 @@ along with this program. If not, see . */ .done(); }, 'exit': function () { + // experiment: Prolog hints + jqTeacherHelp.find('a').off('click'); + jqTeacherHelp.hide(); + // end of experiment: Prolog hints + jqAllButtons.off(); // unregister all event handlers jqAllQuadrants.off(); jqScreen.css('display', 'none'); @@ -250,6 +259,15 @@ along with this program. If not, see . */ .done(); }); + // experiment: Prolog hints + jqTeacherHelp.find('a').on('click', function(e) { + e.preventDefault(); + activityHandler.queueTrace({'typ': 'experiment', 'data': 'teacher help'}); + jqTeacherHelp.hide(); + }); + jqTeacherHelp.show(); + // end of experiment: Prolog hints + codeq.comms.loadProblem(problemDef.id).done(); activityHandler.queueTrace({ 'typ': 'open', -- cgit v1.2.1