summaryrefslogtreecommitdiff
path: root/server/src/server.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/server.cc')
-rw-r--r--server/src/server.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/server/src/server.cc b/server/src/server.cc
index a94a0f8..c0ec223 100644
--- a/server/src/server.cc
+++ b/server/src/server.cc
@@ -168,7 +168,10 @@ static void connection(TCPSocket &socket)
while(mi2 != templ->course.macroes.end()) {
Macro &macro = (*mi2);
- answer += " <macro name=\"" + macro.attributes["name"] + "\">\n";
+ answer += " <macro name=\"" + macro.attributes["name"] + "\" completed=";
+ if(db.checkMacro(transaction.cpr, macro.attributes["name"])) answer += "\"true\"";
+ else answer += "\"false\"";
+ answer += ">\n";
if(macro.attributes["name"] == request.macro) {
@@ -196,7 +199,7 @@ static void connection(TCPSocket &socket)
i++;
}
} catch(std::exception &e) {
- socket.write(error_box( e.what()));
+ socket.write(error_box(xml_encode(e.what())));
}
socket.write("</pracro>\n");
@@ -280,7 +283,7 @@ void server()
char request[] =
"<?xml version='1.0' encoding='UTF-8'?>\n"
"<pracro cpr=\"2003791613\" version=\"1.0\">\n"
- " <request macro=\"example2\" course=\"example2\"/>\n"
+ " <request macro=\"example\" course=\"example\"/>\n"
"</pracro>\n";
int main()