Example #1
0
 function testEditQuiz()
 {
     // Test the forum edits
     edit_quiz($this->quiz_id, 'Quiz2', 10, 'Go', 'Stop', '', 'Nothing', 50, time(), NULL, 3, 0, 'TEST', 1, 'Questions', 'Nothing', '', 0, NULL);
     // Test the forum was actually created
     $this->assertTrue('Quiz2' == get_translated_text($GLOBALS['FORUM_DB']->query_value('quizzes', 'q_name', array('id' => $this->quiz_id))));
 }
Example #2
0
 /**
  * Standard aed_module edit actualiser.
  *
  * @param  ID_TEXT		The entry being edited
  */
 function edit_actualisation($_id)
 {
     $id = intval($_id);
     $open_time = get_input_date('open_time');
     $close_time = get_input_date('close_time');
     $_tied_newsletter = post_param('tied_newsletter', '');
     $tied_newsletter = $_tied_newsletter == '' ? NULL : intval($_tied_newsletter);
     $name = post_param('name');
     $validated = post_param_integer('validated', 0);
     if ($validated == 1 && $GLOBALS['SITE_DB']->query_value('quizzes', 'q_validated', array('id' => $id)) == 0) {
         $submitter = $GLOBALS['SITE_DB']->query_value('quizzes', 'q_submitter', array('id' => $id));
         if (has_actual_page_access($GLOBALS['FORUM_DRIVER']->get_guest_id(), 'quiz')) {
             syndicate_described_activity($submitter != get_member() ? 'quiz:ACTIVITY_VALIDATE_QUIZ' : 'quiz:ACTIVITY_ADD_QUIZ', $name, '', '', '_SEARCH:quiz:do:' . strval($id), '', '', 'quizzes', 1, NULL);
         }
     }
     edit_quiz($id, $name, post_param_integer('timeout', NULL), post_param('start_text'), post_param('end_text'), post_param('end_text_fail'), post_param('notes', ''), post_param_integer('percentage', 0), $open_time, $close_time, post_param_integer('num_winners', 0), post_param_integer('redo_time', NULL), post_param('type'), $validated, post_param('text'), post_param('meta_keywords', ''), post_param('meta_description', ''), post_param_integer('points_for_passing', 0), $tied_newsletter);
 }