MDL-20636 Kill Left over addslashes in the question engine code. #223
This commit is contained in:
@@ -206,7 +206,7 @@ class quiz_statistics_response_analyser {
|
||||
} else {
|
||||
$row->aid = $responseclassid;
|
||||
}
|
||||
$row->response = addslashes($response);
|
||||
$row->response = $response;
|
||||
$row->rcount = $data->count;
|
||||
$row->credit = $data->fraction;
|
||||
$DB->insert_record('quiz_question_response_stats', $row, false);
|
||||
|
||||
+14
-14
@@ -62,8 +62,8 @@ class question_engine_data_mapper {
|
||||
public function insert_questions_usage_by_activity(question_usage_by_activity $quba) {
|
||||
$record = new stdClass();
|
||||
$record->contextid = $quba->get_owning_context()->id;
|
||||
$record->component = addslashes($quba->get_owning_component());
|
||||
$record->preferredbehaviour = addslashes($quba->get_preferred_behaviour());
|
||||
$record->component = $quba->get_owning_component();
|
||||
$record->preferredbehaviour = $quba->get_preferred_behaviour();
|
||||
|
||||
$newid = $this->db->insert_record('question_usages', $record);
|
||||
$quba->set_id_from_database($newid);
|
||||
@@ -82,14 +82,14 @@ class question_engine_data_mapper {
|
||||
$record = new stdClass();
|
||||
$record->questionusageid = $qa->get_usage_id();
|
||||
$record->slot = $qa->get_slot();
|
||||
$record->behaviour = addslashes($qa->get_behaviour_name());
|
||||
$record->behaviour = $qa->get_behaviour_name();
|
||||
$record->questionid = $qa->get_question()->id;
|
||||
$record->maxmark = $qa->get_max_mark();
|
||||
$record->minfraction = $qa->get_min_fraction();
|
||||
$record->flagged = $qa->is_flagged();
|
||||
$record->questionsummary = addslashes($qa->get_question_summary());
|
||||
$record->rightanswer = addslashes($qa->get_right_answer_summary());
|
||||
$record->responsesummary = addslashes($qa->get_response_summary());
|
||||
$record->questionsummary = $qa->get_question_summary();
|
||||
$record->rightanswer = $qa->get_right_answer_summary();
|
||||
$record->responsesummary = $qa->get_response_summary();
|
||||
$record->timemodified = time();
|
||||
$record->id = $this->db->insert_record('question_attempts', $record);
|
||||
|
||||
@@ -107,7 +107,7 @@ class question_engine_data_mapper {
|
||||
$record = new stdClass();
|
||||
$record->questionattemptid = $questionattemptid;
|
||||
$record->sequencenumber = $seq;
|
||||
$record->state = addslashes('' . $step->get_state());
|
||||
$record->state = '' . $step->get_state();
|
||||
$record->fraction = $step->get_fraction();
|
||||
$record->timecreated = $step->get_timecreated();
|
||||
$record->userid = $step->get_user_id();
|
||||
@@ -117,8 +117,8 @@ class question_engine_data_mapper {
|
||||
foreach ($step->get_all_data() as $name => $value) {
|
||||
$data = new stdClass();
|
||||
$data->attemptstepid = $record->id;
|
||||
$data->name = addslashes($name);
|
||||
$data->value = addslashes($value);
|
||||
$data->name = $name;
|
||||
$data->value = $value;
|
||||
$this->db->insert_record('question_attempt_step_data', $data, false);
|
||||
}
|
||||
}
|
||||
@@ -596,8 +596,8 @@ ORDER BY
|
||||
$record = new stdClass();
|
||||
$record->id = $quba->get_id();
|
||||
$record->contextid = $quba->get_owning_context()->id;
|
||||
$record->component = addslashes($quba->get_owning_component());
|
||||
$record->preferredbehaviour = addslashes($quba->get_preferred_behaviour());
|
||||
$record->component = $quba->get_owning_component();
|
||||
$record->preferredbehaviour = $quba->get_preferred_behaviour();
|
||||
|
||||
$this->db->update_record('question_usages', $record);
|
||||
}
|
||||
@@ -613,9 +613,9 @@ ORDER BY
|
||||
$record->maxmark = $qa->get_max_mark();
|
||||
$record->minfraction = $qa->get_min_fraction();
|
||||
$record->flagged = $qa->is_flagged();
|
||||
$record->questionsummary = addslashes($qa->get_question_summary());
|
||||
$record->rightanswer = addslashes($qa->get_right_answer_summary());
|
||||
$record->responsesummary = addslashes($qa->get_response_summary());
|
||||
$record->questionsummary = $qa->get_question_summary();
|
||||
$record->rightanswer = $qa->get_right_answer_summary();
|
||||
$record->responsesummary = $qa->get_response_summary();
|
||||
$record->timemodified = time();
|
||||
|
||||
$this->db->update_record('question_attempts', $record);
|
||||
|
||||
@@ -338,7 +338,7 @@ class question_engine_attempt_upgrader {
|
||||
protected function escape_fields($record) {
|
||||
foreach (get_object_vars($record) as $field => $value) {
|
||||
if (is_string($value)) {
|
||||
$record->$field = addslashes($value);
|
||||
$record->$field = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -747,7 +747,7 @@ abstract class qbehaviour_converter {
|
||||
$this->process_state($submitstate);
|
||||
}
|
||||
|
||||
$step->data['-comment'] = addslashes($this->qsession->manualcomment);
|
||||
$step->data['-comment'] = $this->qsession->manualcomment;
|
||||
if ($this->question->maxmark > 0) {
|
||||
$step->fraction = $state->grade / $this->question->maxmark;
|
||||
$step->state = $this->manual_graded_state_for_fraction($step->fraction);
|
||||
|
||||
@@ -1251,7 +1251,7 @@ class qformat_xml extends qformat_default {
|
||||
case 'multianswer':
|
||||
$acount = 1;
|
||||
foreach ($question->options->questions as $question) {
|
||||
$thispattern = addslashes("{#".$acount."}");
|
||||
$thispattern = "{#".$acount."}";
|
||||
$thisreplace = $question->questiontext;
|
||||
$expout = preg_replace("~$thispattern~", $thisreplace, $expout );
|
||||
$acount++;
|
||||
|
||||
@@ -195,7 +195,7 @@ class qtype_opaque_engine_manager {
|
||||
if ($possibleengineids) {
|
||||
foreach ($possibleengineids as $engineid => $ignored) {
|
||||
$testengine = $this->load_engine_def($engineid);
|
||||
$testengine->passkey = addslashes($testengine->passkey);
|
||||
$testengine->passkey = $testengine->passkey;
|
||||
if ($this->is_same_engine($engine, $testengine)) {
|
||||
return $engineid;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user