コード例 #1
0
ファイル: index.php プロジェクト: vinod-co/centa
         $part_names = $question->get_editable_fields();
         $compound_fields = $question->get_compound_fields();
         $question->populate($part_names, $_POST, $compound_fields);
         // Handle changes in media if not a compound field
         if (!in_array('media', $question->get_compound_fields())) {
             $question->populate_media('q_media', $_FILES, $_POST);
         }
         // Save compound fields
         $question->populate_compound($compound_fields, $_POST, array('media'), $prefix = 'question_');
         // Handle changes in media for compound fields
         if (in_array('media', $compound_fields)) {
             $question->populate_compound_media($_FILES, $_POST, 'q_media', 'question_media');
         }
         // Strip MS Office HTML.
         $question->set_scenario(clearMSOtags($question->get_scenario()));
         $question->set_leadin(clearMSOtags($question->get_leadin()));
         $question_teams = array();
         if (isset($_POST['teams'])) {
             //$question_teams = array_combine($_POST['teams'], $_POST['teams']);
             foreach ($_POST['teams'] as $idMod) {
                 $question_teams[$idMod] = module_utils::get_moduleid_from_id($idMod, $mysqli);
             }
         }
         $question->set_teams($question_teams);
         save_options($question, $userObject, $mysqli);
         $do_save = true;
     }
 } elseif (isset($_POST['submit-cancel']) and $_POST['submit-cancel'] == $string['cancel']) {
     redirect($userObject, $question->id, $configObject, $mysqli);
 }
 if ($do_save) {
コード例 #2
0
ファイル: properties.php プロジェクト: vinod-co/centa
 for ($i = 0; $i < $_POST['internal_no']; $i++) {
     if (isset($_POST["internal{$i}"])) {
         $new_internals[] = intval($_POST["internal{$i}"]);
     }
 }
 $properties->set_paper_prologue(clearMSOtags($_POST['paper_prologue']));
 if (isset($_POST['osce_marking_guidance'])) {
     $properties->set_paper_postscript(clearMSOtags($_POST['osce_marking_guidance']));
 } else {
     $properties->set_paper_postscript(clearMSOtags($_POST['paper_postscript']));
 }
 if ($properties->get_paper_type() == '6') {
     $properties->set_rubric($_POST['type']);
     // Reuse the 'rubric' field to store which field in the metadata to use for groups.
 } else {
     $properties->set_rubric(clearMSOtags($_POST['rubric_text']));
 }
 if (!isset($_POST['marking']) or $_POST['marking'] == '') {
     $properties->set_marking(MARK_NO_ADJUSTMENT);
 } elseif ($_POST['marking'] == MARK_STD_SET) {
     $properties->set_marking($_POST['std_set']);
 } else {
     $properties->set_marking($_POST['marking']);
 }
 $tmp_pass_mark = isset($_POST['pass_mark']) ? $_POST['pass_mark'] : 0;
 if ($tmp_pass_mark == '') {
     $tmp_pass_mark = 40;
 }
 $properties->set_pass_mark($tmp_pass_mark);
 $tmp_distinction_mark = (isset($_POST['distinction_mark']) and $_POST['distinction_mark'] != '') ? $_POST['distinction_mark'] : 70;
 $properties->set_distinction_mark($tmp_distinction_mark);