Minor - Reformat code

skala
Julio Montoya 12 years ago
parent 94cbdc3dbb
commit 0835b10677
  1. 20
      tests/datafiller/fill_exe.php

@ -12,14 +12,15 @@
* internal functions. * internal functions.
* @return array List of user IDs for the users that have just been inserted * @return array List of user IDs for the users that have just been inserted
*/ */
function fill_exe() { function fill_exe()
{
$qc = 5000; //how many questions to create per exercise $qc = 5000; //how many questions to create per exercise
$eol = PHP_EOL; $eol = PHP_EOL;
$courses = array(); //declare only to avoid parsing notice $courses = array(); //declare only to avoid parsing notice
$qst = array(); $qst = array();
require_once 'data_exe.php'; //fill the $users array require_once 'data_exe.php'; //fill the $users array
$output = array(); $output = array();
$output[] = array('title'=>'Exe Filling Report: '); $output[] = array('title' => 'Exe Filling Report: ');
$i = 1; $i = 1;
$lib = api_get_path(SYS_CODE_PATH); $lib = api_get_path(SYS_CODE_PATH);
require_once $lib.'exercice/exercise.class.php'; require_once $lib.'exercice/exercise.class.php';
@ -63,12 +64,22 @@ function fill_exe() {
$question->type = $q['type']; $question->type = $q['type'];
$question->course = $res; $question->course = $res;
$r = $question->save($id); $r = $question->save($id);
if ($r === false) { continue; } if ($r === false) {
continue;
}
$qid = $question->id; $qid = $question->id;
$aid = 1; $aid = 1;
foreach ($q['answers'] as $asw) { foreach ($q['answers'] as $asw) {
$answer = new UniqueAnswer($qid); $answer = new UniqueAnswer($qid);
$answer->create_answer($aid,$qid,$asw['title'],'',$asw['score'],$asw['correct'], $res['real_id']); $answer->create_answer(
$aid,
$qid,
$asw['title'],
'',
$asw['score'],
$asw['correct'],
$res['real_id']
);
$aid++; $aid++;
} }
$qi++; $qi++;
@ -78,5 +89,6 @@ function fill_exe() {
} }
} }
} }
return $output; return $output;
} }

Loading…
Cancel
Save