Skip to content

Commit

Permalink
Add GA for check answers button
Browse files Browse the repository at this point in the history
  • Loading branch information
Graeme Pyle committed Jun 14, 2013
1 parent 0220261 commit 223c295
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions assets/lib/activity-generic-1.3.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
// Original activity and assessment code written by Maggie Johnson
// Refactored version by Philip Guo


var ga='onclick="_gaq.push([\'_trackEvent\', \'activity\', \'checkAnswer\'])"';


// time on page
var gcbBeginningOfTime = new Date();

Expand Down Expand Up @@ -114,7 +118,7 @@ function generateMultipleChoiceQuestion(params, domRoot, index) {
});

domRoot.append('<br>');
domRoot.append('<p/><button class="gcb-button" ' +
domRoot.append('<p/><button class="gcb-button" ' + ga +
'id="submit_' + tag + '">' + trans.CHECK_ANSWER_TEXT + '</button>');
domRoot.append(
'<p/><textarea style="width: 600px; height: 50px;" readonly="true" ' +
Expand Down Expand Up @@ -386,7 +390,7 @@ function generateFreetextQuestion(params, domRoot, index) {
'&nbsp;&nbsp;<input type="text" style="width: 400px; ' +
'class="alphanumericOnly" id="input_' + tag + '">');
if (correctAnswerOutput && incorrectAnswerOutput) {
domRoot.append('<p/><button class="gcb-button" ' +
domRoot.append('<p/><button class="gcb-button" ' + ga +
'id="submit_' + tag + '">' + trans.CHECK_ANSWER_TEXT + '</button>');
}
if (showAnswerOutput) {
Expand Down

0 comments on commit 223c295

Please sign in to comment.