function Problems_Save($id) { global $anstype, $anscount; if (!$this->GetAllowed('CONTEST.MANAGE')) { return; } $name = stripslashes(FormPOSTValue('name', 'ProblemSettings')); $r = db_row_value('tester_problems', '`id`=' . $id); $desc = iframe_accept_content('desc', $r['description']); $s = array(); $s['anstype'] = $anstype; $s['anscount'] = $anscount; $ans = array(); for ($i = 0; $i < $anscount; $i++) { $ans[$i] = array('text' => htmlspecialchars(stripslashes($_POST['ans_text_' . $i])), 'correct' => $_POST['ans_correct_' . $i] ? 1 : 0, 'static' => $_POST['ans_static_' . $i] ? 1 : 0); } $s['ans'] = $ans; db_update('tester_problems', array('name' => db_string($name), 'description' => db_string($desc), 'settings' => db_string(serialize($s))), '`id`=' . $id); }
function UpdateReceived() { global $id; $old_desc = $this->ProblemDescription($id); $s = INFORMATICS_GenerateProblemEditorForm(); $s['desc'] = ' '; if ($this->Update($id, $s)) { $s['desc'] = iframe_accept_content('desc', $old_desc); $this->Update($id, $s); $_POST = array(); return true; } return false; }
function ReceiveValue($field, $formname = '') { $old_val = $this->GetValue(); CDCVirtual::ReceiveValue($field, $formname); $this->SetValue(iframe_accept_content($formname . '_' . $field, $old_val)); }