Changeset 227:fcf26824f258 in SMSSender


Ignore:
Timestamp:
May 30, 2012 6:14:04 PM (8 years ago)
Author:
Sämy Zehnder <saemy.zehnder@…>
Branch:
default
Message:

Schoolnet:

  • Fixed issue where the correct answer could not have been found after answering the question at schoolnet.
  • Fixed issue where the eventTarget fix did not work due to trimmed question texts.
Location:
gateways/Schoolnet/src/business/deepthought
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • gateways/Schoolnet/src/business/deepthought/deepthought_task_answertoschoolnet.cpp

    r226 r227  
    9595        case qiAlreadyAnswered: {
    9696            EException(tr("The correctness of the answer could not have been determined after pushing the answer to schoolnet."))
    97                 .addDebugInfo("html", html)
    98                 .raise();
     97                    .addDebugInfo("html", html)
     98                    .addDebugInfo("fixedEventTarget", fixedEventTarget)
     99                    .raise();
    99100        }
    100101    }
     
    107108 * @return QuestionInfo The info about the correct answer which was extracted from schoolnet.
    108109 */
    109 AnswerToSchoolnetTask::QuestionInfo AnswerToSchoolnetTask::setCorrectAnswerFromHtml(Question &question, QString eventTarget, const QString &html) {
    110     QString submitId = eventTarget.replace(':', '_') + "_cmdAnswer";
     110AnswerToSchoolnetTask::QuestionInfo AnswerToSchoolnetTask::setCorrectAnswerFromHtml(Question &question, const QString &eventTarget, const QString &html) {
     111    QString submitId = eventTarget + "_cmdAnswer";
     112    submitId.replace(':', '_');
    111113
    112114    // Find the question box
  • gateways/Schoolnet/src/business/deepthought/deepthought_tasks.h

    r225 r227  
    8686private:
    8787    void tryAdjustEventTarget(Question &question, const QString &html) const;
    88     QuestionInfo setCorrectAnswerFromHtml(Question &question, QString eventTarget, const QString &html);
     88    QuestionInfo setCorrectAnswerFromHtml(Question &question, const QString &eventTarget, const QString &html);
    8989
    9090private:
  • gateways/Schoolnet/src/business/deepthought/questionmanager.cpp

    r226 r227  
    190190    QRegExp rx("<span id=\"quizQuiz\">\\s*"
    191191                   "<div id=\"divQuestion\">\\s*"
    192                        "<b>" + QRegExp::escape(question.text()) + "</b>\\s*"
     192                       "<b>\\s*" + QRegExp::escape(question.text().trimmed()) + "\\s*</b>\\s*"
    193193                   "</div>\\s*"
    194194                   "<div id=\"quizAnswers\">\\s*"
Note: See TracChangeset for help on using the changeset viewer.