Ejemplo n.º 1
0
<?php

require_once "Android.php";
$obj = new Android();
$obj->dialogCreateAlert("It's time to do some crazy quizzing", "Developed By Amit Kumar Mondal");
$obj->dialogSetPositiveButtonText("Start");
$obj->dialogSetNegativeButtonText("No thanks");
$obj->dialogShow();
$inp = $obj->dialogGetResponse();
if ($inp["result"]->which == "positive") {
    //Question 1
    $qst1_opt = array("Windows 8", "Windows 7", "Windows Vista", "Windows XP");
    $qst1_ans = "Windows 7";
    $qst1 = question($obj, "Q1. Which has the codename Vienna?", $qst1_opt, $qst1_ans);
    //Question 2
    $qst2_opt = array("Go", "NoSQL", "Django", "AES");
    $qst2_ans = "Go";
    $qst2 = question($obj, "Q2. Amongst the following what is a Programming Language?", $qst2_opt, $qst2_ans);
    //Question 3
    $qst3_opt = array("Van Neuman", "Kernighan", "Rasmus Lerdorf", "Belly Deriath");
    $qst3_ans = "Rasmus Lerdorf";
    $qst3 = question($obj, "Q3. Who is the developer of PHP?", $qst3_opt, $qst3_ans);
    //Question 4
    $qst4_opt = array("Library Function", "Initialization Function", "Module Initialization Scheme", "Extension .so/.dll");
    $qst4_ans = "Module Initialization Scheme";
    $qst4 = question($obj, "Q4. What is the MINIT in PHP?", $qst4_opt, $qst4_ans);
    //Question 5
    $qst5_opt = array("echo()", "print()", "fread()", "printf()");
    $qst5_ans = "printf()";
    $qst5 = question($obj, "Q5. Amongst which takes unlimited arguments?", $qst5_opt, $qst5_ans);
    $result = $qst1 + $qst2 + $qst3 + $qst4 + $qst5;
Ejemplo n.º 2
0
<?php

require_once "Android.php";
$object = new Android();
$object->dialogCreateAlert("Quiz Game By", "Amit Kumar Mondal");
$object->dialogSetPositiveButtonText("Proceed");
$object->dialogSetNegativeButtonText("Exit");
$object->dialogShow();
$response = $object->dialogGetResponse();
$function = $response["result"]->which == "positive" ? "proceed" : "exit";
switch ($function) {
    case "proceed":
        $object->dialogCreateAlert("What is Codename for MAC OS X 10.7?");
        $ans11 = array("Lion", "Leopard", "Snow Leopard", "Tiger");
        $object->dialogSetItems($ans11);
        $object->dialogShow();
        $ans1 = $object->dialogGetResponse();
        $ans1m = "Lion";
        if ($ans11[$ans1["result"]->item] == $ans1m) {
            $object->dialogCreateAlert("Result", "Right Answer");
            $object->dialogSetPositiveButtonText("Next");
            $object->dialogShow();
            $next = $object->dialogGetResponse();
            if ($next["result"]->which == "positive") {
                $object->dialogCreateAlert("What is the new Database developed by Google?");
                $ans22 = array("NoSQL", "MongoDB", "F1", "CouchDB");
                $object->dialogSetItems($ans22);
                $object->dialogShow();
                $ans2 = $object->dialogGetResponse();
                $ans2m = "F1";
                if ($ans22[$ans2["result"]->item] == $ans2m) {
Ejemplo n.º 3
0
<?php

// horoscope.php: Proof of Concept retrieving horoscope information
// @author: Javier Infante <jabiAT_NOSP_AMirontec.com>
require_once "Android.php";
$droid = new Android();
$action = "start";
while (true) {
    switch ($action) {
        case "start":
            $droid->dialogCreateAlert("PFA-Horoscope", "Ask PFAewok for your Horoscope");
            $droid->dialogSetPositiveButtonText("ask now!");
            $droid->dialogSetNegativeButtonText("credits...");
            $droid->dialogShow();
            // Wait for user input
            $result = $droid->dialogGetResponse();
            switch ($result['result']->which) {
                case "negative":
                    $action = "credits";
                    break;
                case "positive":
                default:
                    $action = "choose_and_ask";
                    break;
            }
            $droid->dialogDismiss();
            break;
        case "credits":
            $droid->dialogCreateAlert("PFA-Horoscope", "Only for educational Purpouses (what else?).\n\nHoroscope Source: http://widgets.fabulously40.com/horoscope.json\n\nwww.phpforandroid.net");
            $droid->dialogSetPositiveButtonText("back");
            $droid->dialogSetNegativeButtonText("exit");