Phuedx has uploaded a new change for review.
https://gerrit.wikimedia.org/r/191319
Change subject: Instrument the widget-click-none WikiGrok action
......................................................................
Instrument the widget-click-none WikiGrok action
When the submits no correct answers, i.e. they click "None of these",
then log the widget-click-none action.
Change-Id: Ia80cbe0bf7fb94a2d49b1adb810ba3e4846ffc74
---
M includes/Hooks.php
M javascripts/WikiGrokDialogB.js
2 files changed, 17 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiGrok
refs/changes/19/191319/1
diff --git a/includes/Hooks.php b/includes/Hooks.php
index 0e2977a..6f7b52d 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -284,7 +284,7 @@
global $wgResourceModules,
$wgWikiGrokResourceFileModuleBoilerplate;
$wikiGrokEventLoggingSchemas = array(
- 'MobileWebWikiGrok' => 10352247,
+ 'MobileWebWikiGrok' => 10735928,
'MobileWebWikiGrokError' => 10353516,
);
diff --git a/javascripts/WikiGrokDialogB.js b/javascripts/WikiGrokDialogB.js
index 00f5dea..90be0ed 100644
--- a/javascripts/WikiGrokDialogB.js
+++ b/javascripts/WikiGrokDialogB.js
@@ -131,11 +131,19 @@
this.$save = this.$( '.save' );
this.$save.on( 'click', function () {
- var answers = [];
+ var answers = [],
+ hasCorrectAnswer = false;
+
self.$( '.tags .ui-tag-button' ).each( function
() {
- var $this = $( this );
+ var $this = $( this ),
+ correct = $this.is(
'.mw-ui-progressive' );
+
+ if ( !hasCorrectAnswer && correct ) {
+ hasCorrectAnswer = true;
+ }
+
answers.push( {
- correct: $this.is(
'.mw-ui-progressive' ) ? true : null,
+ correct: correct ? true : null,
prop: $this.data( 'propname' ),
propid: $this.data( 'propid' ),
value: $this.data( 'readable' ),
@@ -146,6 +154,11 @@
self.$( '.tags' ).hide();
self.$( '.spinner' ).show();
+
+ if ( !hasCorrectAnswer ) {
+ self.log( 'widget-click-none' );
+ }
+
self.apiWikiGrokResponse.recordClaims( answers
).done( function () {
self.postRecordClaims( options, true );
} ).fail( function () {
--
To view, visit https://gerrit.wikimedia.org/r/191319
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia80cbe0bf7fb94a2d49b1adb810ba3e4846ffc74
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiGrok
Gerrit-Branch: master
Gerrit-Owner: Phuedx <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits