Skip to content

Instantly share code, notes, and snippets.

View vad23klev's full-sized avatar

Vadim Klevtsov vad23klev

  • none
  • Russia, Volgograd
View GitHub Profile
$string = 'Billy was like the other rich kids had a nurse , bicycle and swimming pool , but he never played in the street';
$string = $string.' , did not talk to poor people .';
$enumcorrect = $lang->create_from_string(new qtype_poasquestion\utf8_string($string), 'qtype_correctwriting_processed_string');
$enumdescription1 = array();
$enumdescription1[] = array(new enum_element(8, 9), new enum_element(13, 14), new enum_element(11, 11));
$enumdescription1[] = array(new enum_element(17, 22), new enum_element(24, 29));
$string = 'Billy was like the other rich kids had a nurse , swimming pool and bicycle , but he never played in the street';
$string = $string.' , did not talk to poor people .';
$correct = $lang->create_from_string(new qtype_poasquestion\utf8_string($string), 'qtype_correctwriting_processed_string');
$pair = new qtype_correctwriting_string_pair(clone $correct, clone $corrected, null);
public function test_validate_without_analyzers() {
$language = new block_formal_langs_language_cpp_parseable_language();
$question = new qtype_correctwriting_question();
$question->usecase = true;
$question->lexicalerrorthreshold = 3000;
$question->lexicalerrorweight = 0.1;
$question->usedlanguage = $language;
$question->movedmistakeweight = 0.1;
$question->absentmistakeweight = 0.11;
$question->addedmistakeweight = 0.12;
$lang = new block_formal_langs_language_simple_english;
$string = 'Billy was like the other rich kids had a nurse, bicycle and swimming pool, but he never played in the street,
did not talk to poor people.';
$correct = $lang->create_from_string($string, 'qtype_correctwriting_proccesedstring');
$lang->scan($correct);