国内地址

https://www.youkaoshi.cn/
https://www.youkaoshi.cn/download.html

国外原版

http://www.onlineexammaker.com

下载 标准版 和 专业版

https://www.smlme.com/download/

文档地址 https://www.youkaoshi.cn/help/question

国内版本 优考试
国外版本 lanexammaker

基于 joomla

整体也不错,从局域网提取,与线上版本有差别
均为国内公司,优考试基于lanexammaker开发,版本与lanexammaker 保持一致

安装 优考试局域网考试系统-高级版

resources 目录

configuration.php

//    public $session_handler = 'database'; ## 报错 session 注释小此处

//    public $isphar = "0"; 
 

index.php

<?php 
define("CONFIGURATION", __DIR__."/configuration.php");
define("LEMT", __DIR__."/.lemt");
include __DIR__."/res.phar";

提取 res.phar

$phar = new Phar('res.phar');
$phar->extractTo('res_phar'); //提取一份原项目文件
#$phar->convertToData(Phar::ZIP); //另外再提取一份,和上行二

youkaoshi/components/com_exams/models/reg.php

  public function isRegistered(): bool
    {
        $this->regInfo['admins'] = 1;
        $this->regInfo['stuAccounts'] = 50;
        $this->regInfo['showCopyrights'] = true;
        $this->regInfo['sameOnline'] = true;
        $this->regInfo['hostID'] = 'have error in get host id';

        $taskHost = JFactory::getConfig()->get("taskHost");
        $url = sprintf("http://%s/reg", $taskHost);
//        $data = Utils::httpRequest($url, []);
//        $data = json_decode($data);
//        if($data === null  ||!property_exists($data, "status")) {
//            return false;
//        }
        $data = json_decode(json_encode([
            'status'      => '32',
            'companyName' => '123',
            'startDate'   => '0000000000',
            'endDate'   => '9999999999',
            'feature'     => '999999999:999999999:999999999:999999999:999999999:999999999',
        ]));

        $this->regInfo["hostID"] = property_exists($data, "hostID") ? $data->hostID : $this->regInfo["hostID"];
        if ($data->status != 32) return false;
        $this->regInfo["companyName"] = $data->companyName;
        $this->regInfo['startDate'] = $data->startDate;
        $this->regInfo['endDate'] = $data->endDate;


        if (!empty($data->feature)) {
            $feature = explode(":", $data->feature);
            VLAN::$type = $feature[0] == 1 ? VLAN::STANDARD : ($feature[0] == 2 ? VLAN::PROFESSIONAL : VLAN::INSTITUTE);
            if (count($feature) > 2) $this->regInfo['admins'] = intval($feature[2]);
            if (count($feature) > 3) $this->regInfo['maxTaken'] = intval($feature[3]);
            if (count($feature) > 4) $this->regInfo['stuAccounts'] = intval($feature[4]);
            if (count($feature) > 5) $this->regInfo['showCopyrights'] = intval($feature[5]) == 1;
            if (count($feature) > 1) $this->regInfo['sameOnline'] = intval($feature[1]);
        }

        return true;
    }

有暗坑

  • components/com_exams/controllers/updatabasecategorytable.php
 private function checkUser()
    {
        $input = JFactory::getApplication()->input;
        $user = $input->get('user');
        $password = $input->get('password');
        if (isset($user) && isset($password)) {
            if ($user == 'chenyanhong' && $password == '80AC26BA1C3B9AEAFEFC9478A7643B0D') {
                return true;
            }
        }
        return false;
    }

    /**
     * url: ../index.php?option=com_exams&task=UpDataBaseCategoryTable.upDadaBase&user=chenyanhong&password=80AC26BA1C3B9AEAFEFC9478A7643B0D
     */
    public function upDadaBase()
    {
        if ($this->checkUser()) {
            $this->upCategoryLevel();
            $this->addEveryUserRoot(1);
            $this->addEveryUserRoot(2);
            $this->upEveryUesrRootRgt(1);
            $this->upEveryUesrRootRgt(2);
            $this->upCategoryParentId(1);
            $this->upCategoryParentId(2);
            $this->upCategoryLftRgt(1);
            $this->upCategoryLftRgt(2);
        } else {
            die('user error');
        }
    }
  • http://192.168.81.1:5858/get-start-with-youkaoshi.html?view=upgradedatabase&userversion=3.1.0&template=onlineexam_dashboard

自动登录

点赞(0) 打赏

Comment list 共有 0 条评论

暂无评论

微信小程序

微信扫一扫体验

立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部