Skip to content

Commit

Permalink
Added information about the phone home feature and the option to opt out
Browse files Browse the repository at this point in the history
  • Loading branch information
WilDoane committed Apr 11, 2011
1 parent 7be05a1 commit 334c75a
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 8 deletions.
4 changes: 3 additions & 1 deletion 00HelloWorld/tests/appTest.js
Expand Up @@ -89,7 +89,9 @@ YUI().use('node', 'console', 'test', function(Y) {

reporter.render("#testReport");
Y.Test.Runner.add(unitTests);
Y.Test.Runner.subscribe(Y.Test.Runner.COMPLETE_EVENT, logResultsToServer);
if ( !( isDeclared("phoneHome") && (phoneHome === false) ) ) {
Y.Test.Runner.subscribe(Y.Test.Runner.COMPLETE_EVENT, logResultsToServer);
}
Y.Test.Runner.run();

});
6 changes: 4 additions & 2 deletions 01DieRoll/tests/appTest.js
Expand Up @@ -102,7 +102,7 @@ YUI().use('node', 'console', 'test', function(Y) {

function logResultsToServer(data){
var testResults, serverReporter;

testResults = Y.Test.Runner.getResults();
serverReporter = new Y.Test.Reporter("http://nwghost.com/tdd-collector.php", Y.Test.Format.TAP);
serverReporter.addField("authorsName", authorsNameExists() ? authorsName : "UNKNOWN AUTHOR");
Expand All @@ -115,7 +115,9 @@ YUI().use('node', 'console', 'test', function(Y) {

reporter.render("#testReport");
Y.Test.Runner.add(unitTests);
Y.Test.Runner.subscribe(Y.Test.Runner.COMPLETE_EVENT, logResultsToServer);
if ( !( isDeclared("phoneHome") && (phoneHome === false) ) ) {
Y.Test.Runner.subscribe(Y.Test.Runner.COMPLETE_EVENT, logResultsToServer);
}
Y.Test.Runner.run();

});
4 changes: 3 additions & 1 deletion 02GuessingGame/tests/appTest.js
Expand Up @@ -173,7 +173,9 @@ YUI().use('node', 'console', 'test', function(Y) {

reporter.render("#testReport");
Y.Test.Runner.add(unitTests);
Y.Test.Runner.subscribe(Y.Test.Runner.COMPLETE_EVENT, logResultsToServer);
if ( !( isDeclared("phoneHome") && (phoneHome === false) ) ) {
Y.Test.Runner.subscribe(Y.Test.Runner.COMPLETE_EVENT, logResultsToServer);
}
Y.Test.Runner.run();

});
4 changes: 3 additions & 1 deletion 03LoopedGuessingGame/tests/appTest.js
Expand Up @@ -173,7 +173,9 @@ YUI().use('node', 'console', 'test', function(Y) {

reporter.render("#testReport");
Y.Test.Runner.add(unitTests);
Y.Test.Runner.subscribe(Y.Test.Runner.COMPLETE_EVENT, logResultsToServer);
if ( !( isDeclared("phoneHome") && (phoneHome === false) ) ) {
Y.Test.Runner.subscribe(Y.Test.Runner.COMPLETE_EVENT, logResultsToServer);
}
Y.Test.Runner.run();

});
4 changes: 3 additions & 1 deletion 04ParameterizedGuessingGame/tests/appTest.js
Expand Up @@ -184,7 +184,9 @@ YUI().use('node', 'console', 'test', function(Y) {

reporter.render("#testReport");
Y.Test.Runner.add(unitTests);
Y.Test.Runner.subscribe(Y.Test.Runner.COMPLETE_EVENT, logResultsToServer);
if ( !( isDeclared("phoneHome") && (phoneHome === false) ) ) {
Y.Test.Runner.subscribe(Y.Test.Runner.COMPLETE_EVENT, logResultsToServer);
}
Y.Test.Runner.run();

});
4 changes: 3 additions & 1 deletion 05UserSpecifiedMinMaxGame/tests/appTest.js
Expand Up @@ -178,7 +178,9 @@ YUI().use('node', 'console', 'test', function(Y) {

reporter.render("#testReport");
Y.Test.Runner.add(unitTests);
Y.Test.Runner.subscribe(Y.Test.Runner.COMPLETE_EVENT, logResultsToServer);
if ( !( isDeclared("phoneHome") && (phoneHome === false) ) ) {
Y.Test.Runner.subscribe(Y.Test.Runner.COMPLETE_EVENT, logResultsToServer);
}
Y.Test.Runner.run();

});
11 changes: 11 additions & 0 deletions index.html
Expand Up @@ -15,6 +15,10 @@
width: 800px;
}

#notice {
text-align: left;
}

th {
background-color: #ccccee;
}
Expand Down Expand Up @@ -43,6 +47,13 @@ <h1>Test-Driven Learning (TDL)<br />Introduction to JavaScript</h1>

</script>
</table>
<div id="notice">
<p><em>Privacy Notice:</em> These tasks contain a "phone home" feature that, if you are online while running the tests, sends information to a remote server including the value of the authorsName variable and which tests have failed or passed. The purpose of this information is to see the progress that learners make while working through the tasks and to spot difficulties that many learners encounter that might indicate that a task should be revised.</p>
<p>You can disable the phone home feature by including the following line at the top of your app.js files:</p>
<pre>
var phoneHome = false;
</pre>
</div>
</div>
</body>
</html>
4 changes: 3 additions & 1 deletion template/tests/appTest.js
Expand Up @@ -83,7 +83,9 @@ YUI().use('node', 'console', 'test', function(Y) {

reporter.render("#testReport");
Y.Test.Runner.add(unitTests);
Y.Test.Runner.subscribe(Y.Test.Runner.COMPLETE_EVENT, logResultsToServer);
if ( !( isDeclared("phoneHome") && (phoneHome === false) ) ) {
Y.Test.Runner.subscribe(Y.Test.Runner.COMPLETE_EVENT, logResultsToServer);
}
Y.Test.Runner.run();

});

0 comments on commit 334c75a

Please sign in to comment.