Warning: session_start(): open(/var/lib/php/sessions/sess_g8c8evl5bjrgq2ujfv8qqdl8pv, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
static ReadingComprehensionTest ai_parseReadingComprehensionTest_v1(S rawText) {
new ReadingComprehensionTest test;
LS paragraphs = pnlStruct(paragraphsTokC(rawText));
L isQ = print(map(rcurry_swic("Question"), paragraphs));
int idx = print(falsesFollowedByTrues_changeIndex_assertNotNull(isQ));
LS textPart = takeFirst_clone(paragraphs, idx);
LS questionsPart = sublist(paragraphs, idx);
if (isPreciseMultiDashesHeading(first(textPart))) popFirst(textPart);
test.text = joinWithEmptyLines(textPart);
test.sentences = pnl(sentences(test.text));
for (S s : questionsPart) {
LS lines = tlft(s);
assertEquals(4, l(lines));
assertStartsWith(first(lines), "Question ");
S q = second(lines);
LS answersOnLine = regexpGroups("^1(.+)2(.+)$", third(lines));
assertNempty(answersOnLine);
LS answersOnLine2 = regexpGroups("^3(.+)4(.+)$", last(lines));
assertNempty(answersOnLine2);
LS answers = trimAll(concatLists(answersOnLine, answersOnLine2));
add(test.questions, nu(ReadingComprehensionTest.Question.class, question := q, +answers));
print(q);
printStruct(answers);
}
ret test;
}