当前位置: 首页>>代码示例>>PHP>>正文


PHP Test::from_mysql_id方法代码示例

本文整理汇总了PHP中Test::from_mysql_id方法的典型用法代码示例。如果您正苦于以下问题:PHP Test::from_mysql_id方法的具体用法?PHP Test::from_mysql_id怎么用?PHP Test::from_mysql_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Test的用法示例。


在下文中一共展示了Test::from_mysql_id方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_RCode

 public function get_RCode()
 {
     $code = "";
     $next = $this->get_next_TestSection();
     $next_counter = $next != null ? $next->counter : 0;
     $end_of_loop = $this->is_end_of_loop();
     $loop = null;
     $loop_vals = null;
     if ($end_of_loop) {
         $loop = $this->get_section_loop();
         $loop_vals = $loop->get_values();
         $next_counter = $loop->counter;
     }
     $vals = $this->get_values();
     switch ($this->TestSectionType_id) {
         case DS_TestSectionType::START:
             $test = Test::from_mysql_id($this->Test_id);
             if ($test == null) {
                 return sprintf("stop('Invalid test id: %s in section #%s')", $this->Test_id, $this->counter);
             }
             $code = sprintf("\n                            print('Starting test with id: %s')\n                            CONCERTO_TEST_ID <<- %s\n                            return(%d)\n                            ", $this->Test_id, $this->Test_id, $next_counter);
             break;
         case DS_TestSectionType::END:
             $code = sprintf("\n                    update.session.status(%d)    \n                    update.session.counter(%d)\n                    return(%d)\n                    ", TestSession::TEST_SESSION_STATUS_COMPLETED, $next_counter, $next_counter);
             break;
         case DS_TestSectionType::CUSTOM:
             $cs = CustomSection::from_mysql_id($vals[0]);
             if ($cs == null) {
                 return sprintf("stop('Invalid custom section #%s')", $this->counter);
             }
             $parameters = $cs->get_parameter_CustomSectionVariables();
             $returns = $cs->get_return_CustomSectionVariables();
             $code = "";
             foreach ($parameters as $param) {
                 $val = $param->name;
                 for ($j = 0; $j < $vals[1] * 2; $j = $j + 2) {
                     if ($vals[3 + $j] == $param->name && isset($vals[3 + $j + 1]) && $vals[3 + $j + 1] != "") {
                         $val = $vals[3 + $j + 1];
                         break;
                     }
                 }
                 $code .= sprintf("\n                            %s <- %s\n                            ", $param->name, $val);
             }
             $code .= $cs->code;
             foreach ($returns as $ret) {
                 $val = $ret->name;
                 for ($j = 0; $j < $vals[2] * 2; $j = $j + 2) {
                     if ($vals[3 + $vals[1] * 2 + $j] == $ret->name && isset($vals[3 + $vals[1] * 2 + $j]) && $vals[3 + $vals[1] * 2 + $j] != "") {
                         $val = $vals[3 + $vals[1] * 2 + $j + 1];
                         break;
                     }
                 }
                 $code .= sprintf("\n                            %s <<- %s\n                            ", $val, $ret->name);
             }
             $code .= sprintf("\n                        return(%d)\n                        ", $this->end == 0 ? $next_counter : -2);
             break;
         case DS_TestSectionType::R_CODE:
             $code = sprintf("\n                        %s\n                        return(%d)\n                        ", $vals[0], $this->end == 0 ? $next_counter : -2);
             break;
         case DS_TestSectionType::LOWER_LEVEL_R_CODE:
             $code = sprintf("\n                        %s\n                        ", $vals[0]);
             break;
         case DS_TestSectionType::QTI_INITIALIZATION:
             $ai = QTIAssessmentItem::from_mysql_id($vals[0]);
             if ($ai == null) {
                 return sprintf("stop('Invalid QTI assessment item id: %s in section #%s')", $vals[0], $this->counter);
             }
             $map = QTIAssessmentItem::get_mapped_variables($this->id);
             $result = $ai->validate($map, null, $this->id);
             if (json_decode($result)->result != 0) {
                 return sprintf("stop('Validation failed on QTI assessment item id: %s in section #%s')", $vals[0], $this->counter);
             }
             $qtir = $ai->get_QTI_ini_R_code($map, $this->id);
             $code = sprintf("\n                        %s\n                        return(%d)\n                        ", $qtir, $this->end == 0 ? $next_counter : -2);
             break;
         case DS_TestSectionType::QTI_RESPONSE_PROCESSING:
             $ts = TestSection::from_property(array("counter" => $vals[0], "Test_id" => $this->Test_id), false);
             if ($ts == null) {
                 return sprintf("stop('Invalid test section id: %s in section #%s')", $vals[0], $this->counter);
             }
             $tsvals = $ts->get_values();
             $ai = QTIAssessmentItem::from_mysql_id($tsvals[0]);
             if ($ai == null) {
                 return sprintf("stop('Invalid QTI assessment item id: %s in section #%s')", $tsvals[0], $this->counter);
             }
             $map = QTIAssessmentItem::get_mapped_variables($ts->id);
             $result = $ai->validate($map, null, $ts->id);
             if (json_decode($result)->result != 0) {
                 return sprintf("stop('Validation failed on QTI assessment item id: %s in section #%s')", $tsvals[0], $this->counter);
             }
             $qtir = $ai->get_response_processing_R_code();
             $code = sprintf("\n                        %s\n                        return(%d)\n                        ", $qtir, $this->end == 0 ? $next_counter : -2);
             break;
         case DS_TestSectionType::LOAD_HTML_TEMPLATE:
             $template_id = $vals[0];
             $template = Template::from_mysql_id($template_id);
             if ($template == null) {
                 return sprintf("stop('Invalid template id: %s in section #%s')", $template_id, $this->counter);
             }
             $code = sprintf("\n                        update.session.template_id(%d)\n                        if(!exists('TIME_LIMIT')) TIME_LIMIT <<- 0\n                        update.session.time_limit(TIME_LIMIT)\n                        update.session.status(%d)\n                        update.session.counter(%d)\n                        update.session.template_testsection_id(%d)\n                        update.session.HTML(%d,%d,%d)\n                        update.session.effects('%s','%s','%s','%s')\n                        return(%d)\n                        ", $template_id, TestSession::TEST_SESSION_STATUS_TEMPLATE, $next_counter, $this->id, $this->Test_id, $this->id, $template_id, addcslashes($template->effect_show, "'"), addcslashes($template->effect_hide, "'"), addcslashes($template->effect_show_options, "'"), addcslashes($template->effect_hide_options, "'"), $this->end == 0 ? -1 : -2);
//.........这里部分代码省略.........
开发者ID:Abuamany,项目名称:concerto-platform,代码行数:101,代码来源:TestSection.php

示例2: RCall

 public function RCall($code, $include_ini_code = false, $close = false, $debug_syntax = false)
 {
     $command = "";
     if (!$debug_syntax) {
         if ($include_ini_code) {
             $command = $this->get_ini_RCode();
         } else {
             $command .= $this->get_next_ini_RCode();
         }
     }
     $command .= $code;
     if (!$debug_syntax) {
         $command .= $this->get_post_RCode();
     }
     $output = array();
     $return = -999;
     $command_obj = json_encode(array("session_id" => $this->id, "code" => $command, "close" => 0));
     if (TestServer::$debug) {
         TestServer::log_debug("TestSession->RCall --- checking for server");
     }
     if (!TestServer::is_running()) {
         TestServer::start_process();
     }
     if (TestServer::$debug) {
         TestServer::log_debug("TestSession->RCall --- server found, trying to send");
     }
     $response = TestServer::send($command_obj);
     $result = json_decode(trim($response));
     if (TestServer::$debug) {
         TestServer::log_debug("TestSession->RCall --- sent and recieved response");
     }
     $output = explode("\n", $result->output);
     $return = $result->return;
     $thisSession = null;
     $status = TestSession::TEST_SESSION_STATUS_ERROR;
     $removed = false;
     $release = 0;
     $html = "";
     $head = "";
     $Template_id = 0;
     $debug = 0;
     $hash = "";
     $time_limit = 0;
     $Test_id = 0;
     $finished = 0;
     $loader_HTML = "";
     $loader_head = "";
     $loader_effect_show = "none";
     $loader_effect_hide = "none";
     $loader_effect_show_options = "";
     $loader_effect_hide_options = "";
     $effect_show = "none";
     $effect_hide = "none";
     $effect_show_options = "";
     $effect_hide_options = "";
     if (!$debug_syntax) {
         $thisSession = TestSession::from_mysql_id($this->id);
         if ($thisSession != null) {
             $status = $thisSession->status;
             $release = $thisSession->release;
             $html = $thisSession->HTML;
             $Template_id = $thisSession->Template_id;
             $debug = $thisSession->debug;
             $hash = $thisSession->hash;
             $time_limit = $thisSession->time_limit;
             $Test_id = $thisSession->Test_id;
             $loader_HTML = $thisSession->loader_HTML;
             $loader_head = $thisSession->loader_head;
             $loader_effect_hide = $thisSession->loader_effect_hide;
             $loader_effect_hide_options = $thisSession->loader_effect_hide_options;
             $loader_effect_show = $thisSession->loader_effect_show;
             $loader_effect_show_options = $thisSession->loader_effect_show_options;
             $effect_hide = $thisSession->effect_hide;
             $effect_hide_options = $thisSession->effect_hide_options;
             $effect_show = $thisSession->effect_show;
             $effect_show_options = $thisSession->effect_show_options;
             if ($return != 0) {
                 $status = TestSession::TEST_SESSION_STATUS_ERROR;
             }
             if ($status == TestSession::TEST_SESSION_STATUS_WORKING && $release == 1 || $close) {
                 $status = TestSession::TEST_SESSION_STATUS_COMPLETED;
             }
             $thisSession->status = $status;
             $thisSession->mysql_save();
             switch ($status) {
                 case TestSession::TEST_SESSION_STATUS_COMPLETED:
                     if ($debug) {
                         TestSession::unregister($thisSession->id);
                         $removed = true;
                     } else {
                         $thisSession->serialize();
                     }
                     break;
                 case TestSession::TEST_SESSION_STATUS_ERROR:
                 case TestSession::TEST_SESSION_STATUS_TAMPERED:
                     if ($debug) {
                         TestSession::unregister($thisSession->id);
                         $removed = true;
                     } else {
                         $thisSession->close();
//.........这里部分代码省略.........
开发者ID:Abuamany,项目名称:concerto-platform,代码行数:101,代码来源:TestSession.php

示例3: forward

 public static function forward($tid, $sid, $hash, $values, $btn_name, $debug, $time, $wid = null, $resume_from_last_template = false, $code = null)
 {
     $workspace = UserWorkspace::from_mysql_id($wid);
     if ($workspace != null) {
         mysql_select_db($workspace->db_name);
     } else {
         return false;
     }
     if (is_string($values)) {
         $values = json_decode($values, true);
     }
     $session = null;
     $result = array();
     if ($wid != null && $sid != null && $hash != null) {
         $session = TestSession::authorized_session($wid, $sid, $hash);
         if ($session != null) {
             if ($btn_name != null) {
                 if ($values != null) {
                     $values["LAST_PRESSED_BUTTON_NAME"] = $btn_name;
                 }
             }
             if (Ini::$timer_tamper_prevention && $session->time_limit > 0 && $time - $session->time_tamper_prevention - Ini::$timer_tamper_prevention_tolerance > $session->time_limit) {
                 if ($session->debug == 1) {
                     TestSession::unregister($session->UserWorkspace_id . "-" . $session->id, $session->UserWorkspace_id);
                 } else {
                     $session->close();
                 }
                 $result = array("data" => array("HASH" => $hash, "TIME_LIMIT" => 0, "HTML" => "", "TEST_ID" => 0, "TEST_SESSION_ID" => $sid, "STATUS" => TestSession::TEST_SESSION_STATUS_TAMPERED, "TEMPLATE_ID" => 0, "HEAD" => "", "FINISHED" => 1));
                 if ($session->debug == 1) {
                     $result["debug"] = array("return" => 0, "output" => "", "state" => "[]");
                 }
             } else {
                 $result = $session->RCall($values, $code, $resume_from_last_template);
             }
         } else {
             $result = array("data" => array("HASH" => $hash, "TIME_LIMIT" => 0, "HTML" => "", "TEST_ID" => 0, "TEST_SESSION_ID" => $sid, "STATUS" => TestSession::TEST_SESSION_STATUS_TAMPERED, "TEMPLATE_ID" => 0, "HEAD" => "", "FINISHED" => 1), "debug" => array("return" => 0, "output" => "", "state" => "[]"));
         }
     } else {
         if ($wid != null && $tid != null) {
             if ($debug == 1) {
                 $debug = true;
             } else {
                 $debug = false;
             }
             $test = Test::from_mysql_id($tid);
             if ($test->type != 2) {
                 $session = TestSession::start_new($wid, $tid, $debug);
             }
             if ($values == null) {
                 $values = array();
             }
             if ($test != null && $test->type != 2) {
                 $values = $test->verified_input_values($values);
             } else {
                 $result = array("data" => array("HASH" => $hash, "TIME_LIMIT" => 0, "HTML" => "", "TEST_ID" => $tid, "TEST_SESSION_ID" => $sid, "STATUS" => TestSession::TEST_SESSION_STATUS_TAMPERED, "TEMPLATE_ID" => 0, "HEAD" => "", "FINISHED" => 1), "debug" => array("return" => 0, "output" => "", "state" => "[]"));
                 return $result;
             }
             $result = $result = $session->RCall($values, $code, $resume_from_last_template);
         }
     }
     return $result;
 }
开发者ID:JerzyM,项目名称:concerto-platform,代码行数:62,代码来源:TestSession.php

示例4: Ini

*/
if (!isset($ini)) {
    require_once '../../Ini.php';
    $ini = new Ini();
}
$logged_user = User::get_logged_user();
if ($logged_user == null) {
    echo "<script>location.reload();</script>";
    die(Language::string(278));
}
if (isset($oid)) {
    $parameters = $obj->get_parameter_TestVariables();
    $returns = $obj->get_return_TestVariables();
} else {
    $oid = $_POST['oid'];
    $obj = Test::from_mysql_id($oid);
    $parameters = array();
    if (array_key_exists("parameters", $_POST)) {
        foreach ($_POST['parameters'] as $par) {
            array_push($parameters, json_decode($par));
        }
    }
    $returns = array();
    if (array_key_exists("returns", $_POST)) {
        foreach ($_POST['returns'] as $ret) {
            array_push($returns, json_decode($ret));
        }
    }
    $class_name = $_POST['class_name'];
}
?>
开发者ID:JerzyM,项目名称:concerto-platform,代码行数:31,代码来源:Test_variables.php

示例5: calculate_all_xml_hashes

 public static function calculate_all_xml_hashes()
 {
     //CustomSection - calculate xml_hash
     $sql = "SELECT `id` FROM `CustomSection`";
     $z = mysql_query($sql);
     while ($r = mysql_fetch_array($z)) {
         set_time_limit(0);
         $obj = CustomSection::from_mysql_id($r[0]);
         $obj->xml_hash = $obj->calculate_xml_hash();
         $obj->mysql_save();
     }
     //Table - calculate xml_hash
     $sql = "SELECT `id` FROM `Table`";
     $z = mysql_query($sql);
     while ($r = mysql_fetch_array($z)) {
         set_time_limit(0);
         $obj = Table::from_mysql_id($r[0]);
         $obj->xml_hash = $obj->calculate_xml_hash();
         $obj->mysql_save();
     }
     //Template - calculate xml_hash
     $sql = "SELECT `id` FROM `Template`";
     $z = mysql_query($sql);
     while ($r = mysql_fetch_array($z)) {
         set_time_limit(0);
         $obj = Template::from_mysql_id($r[0]);
         $obj->xml_hash = $obj->calculate_xml_hash();
         $obj->mysql_save();
     }
     //Test - calculate xml_hash
     $sql = "SELECT `id` FROM `Test`";
     $z = mysql_query($sql);
     while ($r = mysql_fetch_array($z)) {
         set_time_limit(0);
         $obj = Test::from_mysql_id($r[0]);
         $obj->xml_hash = $obj->calculate_xml_hash();
         $obj->mysql_save();
     }
 }
开发者ID:Abuamany,项目名称:concerto-platform,代码行数:39,代码来源:OModule.php

示例6: get_Test

 public function get_Test()
 {
     return Test::from_mysql_id($this->Test_id);
 }
开发者ID:Abuamany,项目名称:concerto-platform,代码行数:4,代码来源:TestProtectedVariable.php

示例7: Ini

 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
if (!isset($ini)) {
    require_once '../../Ini.php';
    $ini = new Ini();
}
$logged_user = User::get_logged_user();
if ($logged_user == null) {
    echo json_encode(array());
    exit;
}
$obj = Test::from_mysql_id($_GET['oid']);
if ($obj == null) {
    echo json_encode(array());
    exit;
}
$i = 0;
echo "[";
foreach (TestSessionLog::from_property(array("Test_id" => $obj->id), true, "`created` DESC") as $log) {
    if ($i > 0) {
        echo ",";
    }
    echo json_encode(array("id" => $log->id, "type" => $log->type, "IP" => $log->IP, "browser" => $log->browser, "created" => $log->created, "message" => $log->message));
    $i++;
}
echo "]";
开发者ID:Abuamany,项目名称:concerto-platform,代码行数:31,代码来源:Test_logs_list.php

示例8: mysql_query

?>
        <?php 
$sql = $logged_user->mysql_list_rights_filter("Test", "`name` ASC");
$z = mysql_query($sql);
if (mysql_num_rows($z) > 0) {
    ?>
            <optgroup label="<?php 
    echo Language::string(404);
    ?>
">
                <?php 
    while ($r = mysql_fetch_array($z)) {
        if ($r[0] == $obj->id) {
            continue;
        }
        $cs = Test::from_mysql_id($r[0]);
        ?>
                    <option id="optionSectionType<?php 
        echo DS_TestSectionType::TEST;
        ?>
" value="<?php 
        echo DS_TestSectionType::TEST;
        ?>
:<?php 
        echo $cs->id;
        ?>
" ><?php 
        echo $cs->name;
        ?>
 ( <?php 
        echo $cs->get_system_data();
开发者ID:Abuamany,项目名称:concerto-platform,代码行数:31,代码来源:Test_section_dialog.php

示例9: export

 public function export($xml = null, $sub_test = false, $main_test = null)
 {
     if ($xml == null) {
         $xml = new DOMDocument('1.0', 'UTF-8');
         $export = $xml->createElement("export");
         $export->setAttribute("version", Ini::$version);
         $xml->appendChild($export);
         $xpath = new DOMXPath($xml);
     } else {
         $xpath = new DOMXPath($xml);
         $export = $xpath->query("/export");
         $export = $export->item(0);
     }
     //append subobjects of test
     $tests_ids = array();
     array_push($tests_ids, $this->id);
     $templates_ids = array();
     $custom_sections_ids = array();
     $tables_ids = array();
     $qtiai_ids = array();
     $loader = $this->get_loader_Template();
     if ($loader != null) {
         if (!in_array($loader->id, $templates_ids)) {
             $template = $loader;
             if ($template != null) {
                 $present_templates = $xpath->query("/export/Template");
                 $exists = false;
                 foreach ($present_templates as $obj) {
                     if ($template->xml_hash == $obj->getAttribute("xml_hash")) {
                         $exists = true;
                         break;
                     }
                 }
                 if (!$exists) {
                     $element = $template->to_XML();
                     $obj = $xml->importNode($element, true);
                     $export->appendChild($obj);
                     array_push($templates_ids, $loader->id);
                 }
             }
         }
     }
     $sql = sprintf("SELECT \n            `TestSection`.`id`,`TestSectionValue`.`value`,`TestSection`.`TestSectionType_id` \n            FROM `TestSection` \n            LEFT JOIN `TestSectionValue` ON `TestSectionValue`.`TestSection_id`=`TestSection`.`id`\n            WHERE \n            (`TestSection`.`TestSectionType_id`=13 AND `TestSectionValue`.`index`=0 OR\n            `TestSection`.`TestSectionType_id`=2 AND `TestSectionValue`.`index`=0 OR\n            `TestSection`.`TestSectionType_id`=9 AND `TestSectionValue`.`index`=0 OR\n            `TestSection`.`TestSectionType_id`=11 AND `TestSectionValue`.`index`=0 OR\n            `TestSection`.`TestSectionType_id`=8 AND `TestSectionValue`.`index`=3 OR\n            `TestSection`.`TestSectionType_id`=5 AND `TestSectionValue`.`index`=5) AND `TestSection`.`Test_id`=%d ORDER BY `TestSection`.`TestSectionType_id` ASC", $this->id);
     $z = mysql_query($sql);
     while ($r = mysql_fetch_array($z)) {
         switch ($r[2]) {
             //templates
             case 2:
                 if (!in_array($r[1], $templates_ids)) {
                     $template = Template::from_mysql_id($r[1]);
                     if ($template != null) {
                         $present_templates = $xpath->query("/export/Template");
                         $exists = false;
                         foreach ($present_templates as $obj) {
                             if ($template->xml_hash == $obj->getAttribute("xml_hash")) {
                                 $exists = true;
                                 break;
                             }
                         }
                         if ($exists) {
                             break;
                         }
                         $element = $template->to_XML();
                         $obj = $xml->importNode($element, true);
                         $export->appendChild($obj);
                         array_push($templates_ids, $r[1]);
                     }
                 }
                 break;
                 //QTIAssessmentItem
             //QTIAssessmentItem
             case 13:
                 if (!in_array($r[1], $qtiai_ids)) {
                     $qtiai = QTIAssessmentItem::from_mysql_id($r[1]);
                     if ($qtiai != null) {
                         $present_qtiai = $xpath->query("/export/QTIAssessmentItem");
                         $exists = false;
                         foreach ($present_qtiai as $obj) {
                             if ($qtiai->xml_hash == $obj->getAttribute("xml_hash")) {
                                 $exists = true;
                                 break;
                             }
                         }
                         if ($exists) {
                             break;
                         }
                         $element = $qtiai->to_XML();
                         $obj = $xml->importNode($element, true);
                         $export->appendChild($obj);
                         array_push($qtiai_ids, $r[1]);
                     }
                 }
                 break;
                 //custom sections
             //custom sections
             case 9:
                 if (!in_array($r[1], $custom_sections_ids)) {
                     $custom_section = CustomSection::from_mysql_id($r[1]);
                     if ($custom_section != null) {
                         $present_custom_sections = $xpath->query("/export/CustomSection");
//.........这里部分代码省略.........
开发者ID:Abuamany,项目名称:concerto-platform,代码行数:101,代码来源:Test.php

示例10: get_Test

 public function get_Test()
 {
     TestSession::change_db($this->UserWorkspace_id);
     $session = $this->get_TestSession();
     if ($session == null) {
         return null;
     }
     return Test::from_mysql_id($session->Test_id);
 }
开发者ID:Abuamany,项目名称:concerto-platform,代码行数:9,代码来源:TestInstance.php

示例11: Ini

 of the License, and not any of the later versions.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
if (!isset($ini)) {
    require_once '../../Ini.php';
    $ini = new Ini();
}
$logged_user = User::get_logged_user();
if ($logged_user == null) {
    echo json_encode(array("result" => -1));
    exit;
}
$test = Test::from_mysql_id($_POST['oid']);
if (!$logged_user->is_object_readable($test)) {
    echo json_encode(array("result" => -2));
    exit;
}
$obj = TestSection::from_property(array("Test_id" => $_POST['oid'], "counter" => $_POST['counter']), false);
if ($obj == null) {
    echo json_encode(array("result" => 0, "code" => ""));
    exit;
}
echo json_encode(array("result" => 0, "code" => $obj->get_RCode()));
开发者ID:Abuamany,项目名称:concerto-platform,代码行数:31,代码来源:get_section_code.php

示例12: calculate_all_xml_hashes

 public static function calculate_all_xml_hashes()
 {
     //Table - calculate xml_hash
     $sql = sprintf("SELECT `id` FROM `Table`");
     $z = mysql_query($sql);
     while ($r = mysql_fetch_array($z)) {
         set_time_limit(0);
         $obj = Table::from_mysql_id($r[0]);
         $obj->xml_hash = $obj->calculate_xml_hash();
         $obj->mysql_save();
     }
     //Template - calculate xml_hash
     $sql = sprintf("SELECT `id` FROM `Template`");
     $z = mysql_query($sql);
     while ($r = mysql_fetch_array($z)) {
         set_time_limit(0);
         $obj = Template::from_mysql_id($r[0]);
         $obj->xml_hash = $obj->calculate_xml_hash();
         $obj->mysql_save();
     }
     //QTIAssessmentItem - calculate xml_hash
     $sql = sprintf("SELECT `id` FROM `QTIAssessmentItem`");
     $z = mysql_query($sql);
     while ($r = mysql_fetch_array($z)) {
         set_time_limit(0);
         $obj = QTIAssessmentItem::from_mysql_id($r[0]);
         $obj->xml_hash = $obj->calculate_xml_hash();
         $obj->mysql_save();
     }
     //Test - calculate xml_hash
     $sql = sprintf("SELECT `id` FROM `Test`");
     $z = mysql_query($sql);
     while ($r = mysql_fetch_array($z)) {
         set_time_limit(0);
         $obj = Test::from_mysql_id($r[0]);
         $obj->xml_hash = $obj->calculate_xml_hash();
         $obj->mysql_save();
     }
 }
开发者ID:Abuamany,项目名称:concerto-platform,代码行数:39,代码来源:OModule.php


注:本文中的Test::from_mysql_id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。