// Path: src/main/java/com/lastcalc/servlets/WorksheetServlet.java
// public enum AnswerType {
//     NORMAL, FUNCTION, ERROR
// }


import static com.google.appengine.api.utils.SystemProperty.environment;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.*;
import java.util.logging.Logger;
import com.google.common.collect.*;
import org.jsoup.Jsoup;
import org.jsoup.nodes.*;
import com.google.appengine.api.utils.SystemProperty;
import com.lastcalc.*;
import com.lastcalc.servlets.*;
import com.lastcalc.servlets.WorksheetServlet.AnswerType;
		}
		return cachedHelpDoc;
	}

	private static Document createHelpDoc() throws IOException {
		final Document helpDoc = Jsoup.parse(Help.class.getResourceAsStream("help.html"), "UTF-8", "/");

		helpDoc.outputSettings().charset(Charset.forName("UTF-8"));
		helpDoc.head().appendElement("meta").attr("charset", "UTF-8");
		helpDoc.head().appendElement("meta").attr("http-equiv", "Content-Type")
		.attr("content", "text/html; charset=UTF-8");

		// Process calculations

		final SequentialParser sp = SequentialParser.create();

		for (final Element oldQuestion : helpDoc.select("div.question")) {
			final String questionText = oldQuestion.text();
			oldQuestion.text("");
			oldQuestion.removeClass("question");
			oldQuestion.addClass("helpline").addClass("firstLine");
			final Element line = oldQuestion;
			final TokenList tokenizedQuestion = Tokenizer.tokenize(questionText);
			final TokenList answer = sp.parseNext(tokenizedQuestion);
			// Important to render the question after we've calculated the
			// answer so that variables are lighlighted in the line they are
			// created in
			final String questionAsHtml = Renderers.toHtml("/", tokenizedQuestion, sp.getUserDefinedKeywordMap())
					.toString();
			final TokenList strippedAnswer = sp.stripUDF(answer);
// Path: src/main/java/com/lastcalc/servlets/WorksheetServlet.java
// public enum AnswerType {
//     NORMAL, FUNCTION, ERROR
// }


// Path: src/main/java/com/lastcalc/lessons/Help.java
import static com.google.appengine.api.utils.SystemProperty.environment;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.*;
import java.util.logging.Logger;
import com.google.common.collect.*;
import org.jsoup.Jsoup;
import org.jsoup.nodes.*;
import com.google.appengine.api.utils.SystemProperty;
import com.lastcalc.*;
import com.lastcalc.servlets.*;
import com.lastcalc.servlets.WorksheetServlet.AnswerType;

		}
		return cachedHelpDoc;
	}

	private static Document createHelpDoc() throws IOException {
		final Document helpDoc = Jsoup.parse(Help.class.getResourceAsStream("help.html"), "UTF-8", "/");

		helpDoc.outputSettings().charset(Charset.forName("UTF-8"));
		helpDoc.head().appendElement("meta").attr("charset", "UTF-8");
		helpDoc.head().appendElement("meta").attr("http-equiv", "Content-Type")
		.attr("content", "text/html; charset=UTF-8");

		// Process calculations

		final SequentialParser sp = SequentialParser.create();

		for (final Element oldQuestion : helpDoc.select("div.question")) {
			final String questionText = oldQuestion.text();
			oldQuestion.text("");
			oldQuestion.removeClass("question");
			oldQuestion.addClass("helpline").addClass("firstLine");
			final Element line = oldQuestion;
			final TokenList tokenizedQuestion = Tokenizer.tokenize(questionText);
			final TokenList answer = sp.parseNext(tokenizedQuestion);
			// Important to render the question after we've calculated the
			// answer so that variables are lighlighted in the line they are
			// created in
			final String questionAsHtml = Renderers.toHtml("/", tokenizedQuestion, sp.getUserDefinedKeywordMap())
					.toString();
			final TokenList strippedAnswer = sp.stripUDF(answer);
			final AnswerType answerType = WorksheetServlet.getAnswerType(strippedAnswer);