[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdeedu/kwordquiz/src
From: Peter Hedlund <peter () peterandlinda ! com>
Date: 2004-11-14 0:21:58
Message-ID: 20041114002158.BD52216E52 () office ! kde ! org
[Download RAW message or body]
CVS commit by hedlund:
Highlight (underline) the answers in a Fill-in-the-blank question.
BUG:82355
M +16 -6 wqquiz.cpp 1.11
--- kdeedu/kwordquiz/src/wqquiz.cpp #1.10:1.11
@@ -375,17 +375,19 @@ QString WQQuiz::yourAnswer(int i, const
ls.append(s);
- result = m_answerBlank.replace("..........", "[]");
+ result = m_answerBlank.replace("..........", "<u></u>");
int offset = 0, counter = 0;
while (offset >= 0)
{
- offset = result.find("[", offset);
+ offset = result.find("<u>", offset);
if (offset >= 0)
{
- result.insert(offset + 1, ls[counter]);
+ result.insert(offset + 3, ls[counter]);
offset++;
counter++;
}
}
+ result.append("</qt>");
+ result.prepend("<qt>");
}
else
@@ -490,4 +492,5 @@ QString WQQuiz::blankAnswer(int i)
QString WQQuiz::answer(int i)
{
+ QString s;
WQListItem *li = m_list->at(i);
int j;
@@ -504,9 +507,16 @@ QString WQQuiz::answer(int i)
if (m_quizType == qtQA)
{
- return m_table->text(li->oneOp(), j);
+ s = m_table->text(li->oneOp(), j);
+ if (m_enableBlanks)
+ {
+ s.replace("[", "<u>");
+ s.replace("]", "</u>");
+ s.prepend("<qt>");
+ s.append("</qt>");
+ }
}
else
{
- QString s = m_table->text(li->oneOp(), j);
+ s = m_table->text(li->oneOp(), j);
if (m_enableBlanks)
{
@@ -514,6 +524,6 @@ QString WQQuiz::answer(int i)
s.remove("]");
}
- return s;
}
+ return s;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic