/** * @desc Test creation of a wwquestion directory */ function test_create_wwquestion_directory() { webwork_make_wwquestion_dir('SIMPLETEST'); $path = webwork_get_wwquestion_path_full('SIMPLETEST'); $this->assertEqual(is_dir($path), true, 'Webwork Question Directory Creation Test.'); webwork_delete_wwquestion_dir('SIMPLETEST'); }
/** * @desc Deletes question from the question_webwork table * @param integer $questionid The question being deleted * @return boolean to indicate success of failure. */ function delete_question($questionid) { //Get wwquestion from DB $record = get_record('question_webwork', 'question', $questionid); $wwquestionid = $record->id; //delete DB and Files webwork_delete_wwquestion_dir($wwquestionid); delete_records('question_webwork', 'id', $wwquestionid); //delete derivations webwork_delete_derivations_db($wwquestionid); return true; }