npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

iteach-plugins-tk

v1.5.30

Published

``` Bank // 题库组件 questionTypeConfig // 题型-组件映射 配置文件

Downloads

79

Readme

export

Bank // 题库组件
questionTypeConfig // 题型-组件映射 配置文件

DanXuan // 单选(包括多选)
Fill // 填空
PeiDui // 配对
ZhuGuan // 主观
FuHe // 复合
Sequencing // 排序
ShuDu // 数独
Completion // 补全
Cloze // 完形填空
PanDuan // 判断

<component
  :is="componentName"
  :content="questionInfo"
  :small-questions="smallQuestions"
  :analysis-status="unit.analysisStatus">
</component>

@Component({
  components: {
    'dan-xuan': DanXuan,
    'fill': Fill,
    'pei-dui': PeiDui,
    'zhu-guan': ZhuGuan,
    'fu-he': FuHe,
    'sequencing': Sequencing,
    'shu-du': ShuDu,
    'completion': Completion,
    'cloze': Cloze,
    'pan-duan: PanDuan
  }
})

public get componentName(): any {
  // structureType 为题库题型
  return questionTypeConfig[structureType] || {};
}

Bank Props

[required]
1.base-params

public baseParams: any = {
  subjectId: '2'
};

2.color (6位 hex 颜色格式 不支持rgba)

public color: string = '#31C27C';

3.extend-tabs

public extendTabs: { label: string; value: string; }[] = [{ label: '切片', value: 'slice' }];
提供插槽 solt name="slice"

4.city-list

public cityList: string[] = []; // 分校ID
默认集团['65']

5、queryParams 题的查询参数(中文)
queryParams={
  tikuType?: string;
  businessType?: string; //单选题
  schNumber?: string;
  paperUsage?: string;
  grade?: string;
  difficulty?: string;
  knwIds?: string[];
}

6、knowTreeDirection 知识树方向 
public knowTreeDirection:string = 'vertical'
默认横向 horizontal

7、haveAddOperation 是否需要操作按钮(添加)
  public haveAddOperation: boolean = false
  默认有操作按钮 true
8、newTabs 新的tab标签列表 如果有不需要显示的标签请传入,没有则不需要传
   [{label:'试卷', hide: true}]


Bank Emit func

@add-question="addQuestion"

public addQuestion(questions: any[]): void {
  console.log('addQuestion', questions);
}
questions数据结构如下:
[
  {
    // <-- tk提供字段 -->
    id: '',
    questionId: '',
    structureType: '', // 题型
    questionInfo: { // 试题信息
      stem: '', // 题干 (html string)
      options: [ // 选项
        {
          optCode: '',
          htmlCode: '', // html string
          title: ''
        },
        ...
      ],
      answer: '', // 答案 (html string | any[])
      analysis: '' // 解析
    },
    smallQuestions: [ // 子题信息 数据结构与questions-item相同
      ...
    ],
    // <-- 解析提供字段 -->
    questionInfoText: {
      stem: {
        // 文本 string (图片:`@image${index}@`;音频:`@audio${index}@`;填空:@fill@;数字填空:@fill1@;公式:$....$)
        text: '',
        audio: ['', ...], // 音频url string[]
        img: ['', ...] // 图片url string[]
      },
      options: [ // 选项
        {
          optCode: '',
          htmlCode: '',
          title: '',
          htmlCodeText: {
            text: '',
            audio: ['', ...],
            img: ['', ...]
          }
        },
        ...
      ],
      answer: {
        text: '',
        audio: ['', ...],
        img: ['', ...]
      },
      analysis: {
        text: '',
        audio: ['', ...],
        img: ['', ...]
      }
    },
    smallQuestionsText: [ // 子题信息 数据结构与questions-item相同
      ...
    ]
  },
  ...
]

工程结构

导出文件 index.js
打包文件 src/index.ts
demo src/App.vue & src/main.ts
题型结构mock数据 questionData.ts

文档

题型数据结构文档 http://confluence.staff.xdf.cn/pages/viewpage.action?pageId=339345512#TIKU%E7%8E%B0%E6%9C%89%E7%BB%93%E6%9E%84%E9%A2%98%E5%9E%8B%E6%A2%B3%E7%90%86-1%E3%80%81%E5%8D%95%E9%80%89%E9%A2%98

发布流程

1.注册npm账号:https://www.npmjs.com/
2.加入群组:https://www.npmjs.com/settings/pop-iteach/members
3.修改package.json中版本号verson
4.在项目中切换npm源:指令 npm config set registry https://registry.npmjs.org
5.在项目中登录npm用户:npm adduser
6.发布:npm publish(package.json中配置了prepare命令,publish自动build)
7.切回淘宝镜像:npm config set registry https://registry.npm.taobao.org
8.获取npm包tgz格式的下载地址:npm view 包名 dist.tarball 
9.将下载的包上传至 http://nexus.staff.xdf.cn/ 打开地址-登录-点击Upload-点击npm-hosted
10.提交代码合并分支

版本

xx.xx.xx 大版本迭代更新-部分功能迭代更新-bug修复小功能迭代

history
1.0.x 题库上线版本
1.1.0 新增解析html文本功能
  1.1.1 修复试题样式问题
  1.1.2 修复试题样式问题 - 字号不统一
  1.1.3 修复试题样式问题 - 答案解析样式被覆盖
  1.1.4 修复试题样式问题 - 复合题样式被覆盖
1.2.0 提供扩展插槽能力 新增过滤机构权限逻辑
  1.2.1 规范参数 修复非必填参数报错bug
  1.2.2 修复后端字段不完整导致的bug
  1.2.3 修复试卷给分校设置默认值报错bug
  1.2.4 update verson
  1.2.5 修复控制台警告
  1.2.6 测试修复学科下拉不展示问题
  1.2.7 添加试卷机构
1.3.0 重构试卷;新增试题组件教师、学生模式,默认学生模式;新增判断题题型;图片音频增加解析位置功能;已知bug修复
  1.3.1 修复判断题组件没有导出bug
  1.3.2 修复知识树下拉不消失bug,分数样式bug
  1.3.3 修复试卷翻页
  1.3.4 e2校验
  1.3.5 e2校验build
  1.3.6 http / https自适应
  1.3.7 修改测试环境域名
1.4.0 更改查询条件的交互模式
  1.4.1 适配符合题判断子题,样式内联
  1.4.2 修复打包命令中输出文件名称
  1.4.3 兼容接口为null
  1.4.4 解决请求异步返回问题
  1.4.5 添加试卷默认查询条件
  1.4.6 优化试卷初始化逻辑
  1.4.7 样式修复(下载)
  1.4.8 滚动条样式删除

target
  1.5.0 修改中央题库默认值、添加换行css