CodePart[] devideSolution() { var codeParts = new List <CodePart>(); //split solution var parts = _levelData["given"].ToString().Split(new string[] { "[[", "]]" }, StringSplitOptions.None); //declare clock variable: true means the content is the index of the solution part in the database bool clock = parts[0].StartsWith("[["); foreach (string part in parts) { if (clock) { //create codepart int index = Convert.ToInt32(part); string code = Snippets.getSolution(index, _userData); var codePart = new CodePart(index, code); //append codepart codeParts.Add(codePart); } else { //create codepart var codePart = new CodePart(null, part); //append codepart codeParts.Add(codePart); } //tick clock = !clock; } return(codeParts.ToArray()); }
protected void Congratulate(bool passed) { Snippets.alert(passed ? "Glückwunsch! Sie haben diese Aufgabe bestanden." : "Das war nicht richtig. Bitte überprüfe noch einmal deine Antwort."); }