HTML 心理测试源码简写

<!DOCTYPE html>

<html lang="en">

<head>

  <meta charset="UTF-8">

  <meta http-equiv="X-UA-Compatible" content="IE=edge">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>心里测试系统</title>

  <style>

    .headPart {

      width: 100%;

      text-align: center;

      font-size: 12px;

    }

    .h1part {

      width: 14%;

      display: inline-block;

    }

    .h1part span {

      font-size: 16px;

      font-weight: bold;

    }

    .h2part {

      width: 68%;

      display: inline-block;

    }

    .h3part {

      width: 14%;

      display: inline-block;

    }

    .progress-container,

    .progress-container .progress {

      height: 10px;

      border-radius: 5px;

      overflow: hidden;

    }

 

    .progress-container {

      background-color: rgba(0, 0, 0, .1)

    }

    .progress-container .progress {

      width: 0%;

      background-color: #ffde2d;

    }

    /* 题目区域 ------------------------------*/

    .quesPart {}

    /* 题目标题 */

    .quesPart h1 {

      font-size: 18px;

    }

    /* 选项列表 */

    .quesPart .answerList {

      list-style: none;

      padding: 0px;

    }

    /* 选项列表 项目 */

    .quesPart .answerList li {

      border: 1px solid #e3dbdb;

      margin: 10px;

      /* padding: 10px 20px; */

      padding: 10px 20px 10px 20px;

      border-radius: 10px;

    }


 

    /* 选项列表 项目 选项序号 A/B/C/D */

    .quesPart .answerList li .opt {

      display: inline-block;

      width: 7%;

      text-align: left;

    }

    /* 选项列表 项目 选项内容 */

    .quesPart .answerList li .optContent {

      display: inline-block;

      width: 80%;

    }

    /* 选项列表 项目 单选按钮 */

    .quesPart .answerList li .optRadio {

      display: inline-block;

      width: 7%;

    }

    /* 选项列表 项目 单选按钮  伪类选择器  */

    input[type='radio']:after {

      width: 12px;

      height: 12px;

      border-radius: 12px;

      top: -2px;

      left: -1px;

      position: relative;

      background-color: #fff;

      content: '';

      display: inline-block;

      visibility: visible;

      border: 2px solid #ffde2d;

    }

    /* 选项列表 项目 单选按钮 选中时的 伪类选择器  */

    input[type='radio']:checked:after {

      width: 12px;

      height: 12px;

      border-radius: 12px;

      top: -2px;

      left: -1px;

      position: relative;

      background-color: #ffde2d;

      content: '';

      display: inline-block;

      visibility: visible;

      border: 2px solid white;

    }

  • 1
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
心理测试 PHP 源码是一个通过使用 PHP 编程语言编写的程序,用于进行心理测试和分析。下面是一个简单的示例源码: ```php <?php // 心理测试题目和选项 $questions = array( "question1" => array( "question" => "你喜欢独自一人去旅行吗?", "options" => array( "A" => "是的,我很享受独自旅行的时光", "B" => "不,我喜欢和朋友或家人一起旅行", "C" => "有时候喜欢一个人出门,有时候喜欢与人同行" ) ), "question2" => array( "question" => "当你遇到困难时,你会如何应对?", "options" => array( "A" => "我会寻求他人的帮助和建议", "B" => "我喜欢独自解决问题", "C" => "我会尝试自己解决,如果不行再找别人帮忙" ) ), // 添加更多题目 ... ); // 处理提交的答案 if($_SERVER['REQUEST_METHOD'] == 'POST') { $answers = $_POST['answers']; $result = analyzeAnswers($answers); displayResult($result); } // 分析答案返回结果 function analyzeAnswers($answers) { // 根据答案计算得分并返回结果 // 实现逻辑 ... return $result; } // 显示结果 function displayResult($result) { // 根据结果展示测试结果 // 实现逻辑 ... } ?> <!-- 在 HTML 中显示心理测试题目和接收答案 --> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <?php foreach($questions as $key => $question): ?> <p><?php echo $question['question']; ?></p> <?php foreach($question['options'] as $optionKey => $option): ?> <input type="radio" name="answers[<?php echo $key; ?>]" value="<?php echo $optionKey; ?>"> <?php echo $option; ?><br> <?php endforeach; ?> <?php endforeach; ?> <input type="submit" value="提交"> </form> ``` 上述代码展示了一个简单的心理测试程序。该程序通过使用 PHP 编码,实现了心理测试问题和选项的展示,接收用户的答案并进行分析,最后显示测试结果。用户可以选择不同的答案,并提交测试结果。在实际应用中,可以根据具体需求添加更多问题和更复杂的答案分析逻辑。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Aluoyu

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值