- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
function getTestDataById ($testid) {
$query="select * from mdl_test where id=".$testid."";
$result = mysql_query($query) or die('getTestDataById query failed: ' . mysql_error());
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$courseid=$row['courseid'] ;
$moduleid=$row['moduleid'];
$name=$row['name'];
$maxscore=$row['maxscore'];
$successscore=$row['successscore'];
$attempts=$row['attempts'];
$dur=$row['dur'];
$showsuccessmessage=$row['showsuccessmessage'];
$successmessage=$row['successmessage'];
$showfailedmessage=$row['showfailedmessage'];
$failedmessage=$row['failedmessage'];
$showtestsuccessmessage=$row['showtestsuccessmessage'];
$testsuccessmessage=$row['testsuccessmessage'];
$showtestfailedmessage=$row['showtestfailedmessage'];
$testfailedmessage=$row['testfailedmessage'];
$freequestions=$row['freequestions'];
$questionsorder=$row['questionsorder'];
$defertest=$row['defertest'];
$totalperpage=$row['totalperpage'];
$showcorrectreply=$row['showcorrectreply'];
$showscore=$row['showscore'];
$limittype = $row['limittype'];
$annotation = $row['annotation'];
} // end while
$res=array('courseid'=>$courseid,
'moduleid'=>$moduleid,
'name'=>stripslashes($name),
'maxscore'=>$maxscore,
'successscore'=>$successscore,
'attempts'=>$attempts,
'dur'=>$dur,
'showsuccessmessage'=>$showsuccessmessage,
'successmessage'=>stripslashes($successmessage),
'showfailedmessage'=>$showfailedmessage,
'failedmessage'=>stripslashes($failedmessage),
'showtestsuccessmessage'=>stripslashes($showtestsuccessmessage),
'testsuccessmessage'=>stripslashes($testsuccessmessage),
'showtestfailedmessage'=>stripslashes($showtestfailedmessage),
'testfailedmessage'=>stripslashes($testfailedmessage),
'freequestions'=>stripslashes($freequestions),
'questionsorder'=>stripslashes($questionsorder),
'defertest'=>stripslashes($defertest),
'totalperpage'=>stripslashes($totalperpage),
'showcorrectreply'=>stripslashes($showcorrectreply),
'showscore'=>stripslashes($showscore),
'limittype' => stripslashes($limittype), // Total 21 items
'annotation' => stripslashes($annotation));
return $res;
} // end of function