Physikerwelt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/255805

Change subject: Add UI text elements for step 1
......................................................................

Add UI text elements for step 1

Change-Id: Ie070b7104b634f86f42c35d6d3bc0901a99a6da8
---
M i18n/en.json
M i18n/qqq.json
M includes/MlpEvalForm.php
M includes/special/SpecialMlpEval.php
4 files changed, 49 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch 
refs/changes/05/255805/1

diff --git a/i18n/en.json b/i18n/en.json
index 478f9b3..1b351e6 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -17,6 +17,17 @@
        "getequationsbyquery": "Get equations by query",
        "xquerygenerator": "XQuery generator",
        "mathdebug": "Test Renderer",
+       "math-lp-intro": "Dear participant,\nthank you for participating in the 
evaluation for improving the math support in Wikipedia. The study evaluates the 
quality of mathematical formulae on Wikipedia with regard to three 
aspects:\n\n# LaTeX input: Is the formula source code typed correctly? (Using 
<syntaxhighlight lang=\"latex\" inline>\\sin</syntaxhighlight> instead of 
<syntaxhighlight lang=\"latex\" inline>sin</syntaxhighlight>)\n# Rendering: Is 
the formula displayed correctly? (Even correct LaTeX input might lead to 
unreadable formulae on certain devices.)\n# Semantics: Is the Wikipedia Math 
extension capable of capturing the formulae semantics correctly? 
(<math>f(a+b)</math> might stand for the \"function <math>f</math> applied the 
sum of <math>a</math> and <math>b</math>\" or \"variable <math>f</math> times 
the sum of <math>a</math> plus <math>b</math>\")\n\nIn the following, you will 
be guided through a five step evaluation process.",
+       "math-lp-head-1": "==Step 1: Select a Wikipedia article you are 
familiar with==",
+       "math-lp-1-selection-label": "Page title",
+       "math-lp-1-selection-help": "This input field below is prefilled with a 
randomly chosen Wikipedia Article that contains mathematics. You have three 
options\n# Click \"continue\" to proceed with this article.\n# Type the title 
of an article you want to evaluate and click \"continue\" thereafter.\n# Click 
\"select another random article\" to reload this page and get a new randomly 
selected article.",
+       "math-lp-1-submit-label": "continue",
+       "math-lp-1-rand-label": "select another random article",
+       "math-lp-head-2": "==Step 2: Select a formula==",
+       "math-lp-head-3": "==Step 3: LaTeX code==",
+       "math-lp-head-4": "==Step 4: Context independent semantics==",
+       "math-lp-head-5": "==Step 5: Context dependent semantics==",
+       "math-lp-head-6": "==Finished: Thank you for your participation==",
        "math-wmc-attach-results-help": "Sometimes a single run contains to 
many results for one file upload. In that case the upload has to be split into 
several files.",
        "math-wmc-attach-results-label":"Attach more results to existing run",
        "math-wmc-download-intro": "Download your previously submitted runs 
here. The file contains only valid hits. All invalid hits have been removed.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 7955cd3..48c4e8b 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -22,6 +22,17 @@
        "getequationsbyquery": "{{doc-special|GetEquationByQuery}}",
        "xquerygenerator": "{{doc-special|XQueryGenerator}}",
        "mathdebug": "{{doc-special|MathDebug}}",
+       "math-lp-intro": "Welcome message for participants of the 
\"Mathematical Language Processing evaluation\" survey.",
+       "math-lp-head-1": "Headline for survey step 1",
+       "math-lp-1-selection-label": "Label for page selection box.",
+       "math-lp-1-selection-help": "Help text for page selection box.",
+       "math-lp-1-submit-label": "Label message for submission of step 1.",
+       "math-lp-1-rand-label": "Label message for reset of step 1.",
+       "math-lp-head-2": "Headline for survey step 2",
+       "math-lp-head-3": "Headline for survey step 3",
+       "math-lp-head-4": "Headline for survey step 4",
+       "math-lp-head-5": "Headline for survey step 5",
+       "math-lp-head-6": "Headline for survey final step 6",
        "math-wmc-attach-results-help": "Form label help text",
        "math-wmc-attach-results-label": "Form label",
        "math-wmc-download-intro": "Introductory text for MathDownload special 
page.",
diff --git a/includes/MlpEvalForm.php b/includes/MlpEvalForm.php
index 79e55f8..1e37cfa 100644
--- a/includes/MlpEvalForm.php
+++ b/includes/MlpEvalForm.php
@@ -22,6 +22,7 @@
                $this->mWasSubmitted = false;
                $this->addStateFields();
                $this->addButtons();
+               $this->setSubmitDesc();
                $this->setSubmitCallback( function(){
                        return false;
                } );
@@ -32,10 +33,10 @@
                switch ( $this->step ){
                        case SpecialMlpEval::STEP_PAGE:
                                $s = array(
-                                               'label'    => 'Select page to 
evaluate.',
-                                               'class'    => 
'HTMLTitleTextField',
-                                               'readonly' => 
$this->specialPage->getStep() > 1 ? true : false,
-                                               'default'  => 
$this->specialPage->getRandomPage()->getText()
+                                       'label-message' => 
'math-lp-1-selection-label',
+                                       'help-message'  => 
'math-lp-1-selection-help',
+                                       'class'         => 'HTMLTitleTextField',
+                                       'default'       => 
$this->specialPage->getRandomPage()->getText()
                                );
                                $formDescriptor['evalPage'] = $s;
                                break;
@@ -102,6 +103,22 @@
        }
 
        private function addButtons() {
-               $this->addButton( "pgRst", "Select another random page" );
+               $this->addButton( "pgRst", wfMessage( "math-lp-1-rand-label" 
)->inContentLanguage()->text() );
+       }
+
+       private function setSubmitDesc() {
+               switch ( $this->step ){
+                       case SpecialMlpEval::STEP_PAGE:
+                               $this->setSubmitTextMsg( 
"math-lp-1-submit-label" );
+                               break;
+                       case SpecialMlpEval::STEP_FORMULA:
+                               break;
+                       case SpecialMlpEval::STEP_STYLE:
+                               break;
+                       case SpecialMlpEval::STEP_IDENTIFIERS:
+                               break;
+                       case SpecialMlpEval::STEP_DEFINITIONS:
+                               break;
+               }
        }
 }
diff --git a/includes/special/SpecialMlpEval.php 
b/includes/special/SpecialMlpEval.php
index 91e361e..5574be2 100644
--- a/includes/special/SpecialMlpEval.php
+++ b/includes/special/SpecialMlpEval.php
@@ -255,10 +255,15 @@
        }
 
        private function printIntorduction() {
+               $this->enableMathStyles();
                $out = $this->getOutput();
                $out->addWikiText( "Welcome to the MLP evaluation. Your data 
will be recorded." );
                $out->addWikiText( "You are in step {$this->step} of possible 
evaluation 5 steps" );
                switch ( $this->step ) {
+                       case self::STEP_PAGE:
+                               $out->addWikiMsg( 'math-lp-intro' );
+                               $out->addWikiMsg( 'math-lp-head-1' );
+                               break;
                        case self::STEP_FORMULA:
                                $this->fId = $this->getRandomFId();
                                $this->printFormula();
@@ -276,7 +281,6 @@
                                $this->DisplayRendering( 
$mo->getUserInputTex(), 'png' );
                                break;
                        case self::STEP_IDENTIFIERS:
-                               $this->enableMathStyles();
                                $mo = MathObject::newFromRevisionText( 
$this->oldId, $this->fId );
                                $md = $mo->getTexInfo();
                                $this->printFormula();

-- 
To view, visit https://gerrit.wikimedia.org/r/255805
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie070b7104b634f86f42c35d6d3bc0901a99a6da8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt <w...@physikerwelt.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to