Giter Club home page Giter Club logo

vscode-pintia's Introduction

Pintia

在 VS Code 中练习 Pintia 公共题集

‼️ 如果您在**, 可访问 Gitee. ‼️

⬇️ 安装 Pintia: Visual Studio Marketplace, VS Code or Install from VSIX

0. 运行条件

1. 功能

1.1 登录/登出

登录

  • 只需在 Pintia Explorer 中点击 Sign in PTA ,即可登录PTA。(目前,只支持微信二维码登录)。

  • 你也可以使用以下命令来登录/退出。

    • Pintia: Sign In
    • Pintia: Sign Out

1.2 预览题目

预览问题

  • 点击问题,即可查看问题描述

    注意:

    • 您可以通过修改配置项 pintia.workspaceFolder 来指定存储题目文件的工作区路径。默认值为 $HOME/.pintia/codes

    • 您可以通过 Pintia: Change Default Language 命令来更换默认语言


1.3 编辑器快捷键

编辑器快捷键

  • 该插件支持2个编辑器快捷键

    • Submit:向 Pintia 提交你的答案
    • Test:用 自定义的测试样例默认样例 测试你的答案
    • Preview: 在源文件中打开习题预览

1.4 自定义测试样例

自定义测试样例

  • 您可以把您的代码放在 @pintia code=start@pintia code=end 之间(在编辑区中输入 ptacode 来快速添加)
  • 另外,您可以把您的 自定义测试样例 放在 @pintia test=start@pintia test=end 之间(输入 ptatest 可以快速添加),并点击 Test custom sample 以快速测试您的代码。

Note: 在点击 submittest 提交你的代码时,只有在包裹在 @pintia code=start@pintia code=end 之间的代码会被提交给 Pintia 判题器。


1.5 搜索题目

点击 Pintia 视图顶部的 搜索 图标,或者打开 命令面板,使用 Pintia: Search Problem 快捷命令。

搜索题目


1.6 笔记功能

你可以在代码编辑区键入 ptanote 生成笔记块,在其中输入你的笔记,下次预览题目时,笔记会以 Markdown 的形式解析并预览。

笔记

Note: 笔记是随着代码一起提交到 拼题A 的,并不存在本地。提交代码后,重新点击编辑器的 Preview,或者下次预览本题时,会显示你的笔记。


1.7 题目收藏

你可以在题目集中点击右侧的按钮收藏题目。该功能不依赖于官方的服务,因此只能将收藏的题目存储在本地。后续会考虑使用其他方式实现数据的同步。


1.8 代码片段

你可以在代码编辑器中输入以下前缀来快速生成相应的代码块,如下所示。

前缀 说明
ptacode 把你的自定义测试样例放在 @pintia code=start/end 中,当你点击 Submit 按钮时,插件会自动识别它
ptatest 将你的自定义测试样例放在 @pintia test=start/end 中,当你点击 Test 按钮时,插件会自动识别它
ptacpp_stdc++ 获取头文件为 bits/stdc++.h 的 cpp 模板
ptacpp_iostream 获取带有 iostream 头文件的 cpp 模板
ptaclang 获取带有头文件 stdio.h 的 clang 模板
ptajava_buffer 获取带有 BufferReader 的 java 模板
ptajava_scanner 获取带有 Scanner 的 java 模板
ptanote 生成 @pintia note=start/end 笔记块

2. 插件使用

使用 Ctrl+Shift+P (in Windows) 或 Command+Shift+P (in Mac)打开命令面板并输入 pintia 可快速使用插件的相关命令。

命令面板

3. 插件配置项

设置名称 描述 默认值
pintia.showLocked 指定是否显示锁定的问题(一些题目集需要验证用户的读者码后方可提交) true
pintia.defaultLanguage 指定用于解题的默认语言。支持的语言有C (gcc), C++ (g++), C (clang), C++ (clang++), Java (javac), Python (python2), Python (python3), Ruby (ruby), Bash (bash), Plaintext (cat), CommonLisp (sbcl), Pascal (fpc), Go (go), Haskell (ghc), Lua (lua), Lua (luajit), C# (mcs), JavaScript (node), OCaml (ocamlc), PHP (php), Perl (perl), AWK (awk), D (dmd), Racket (racket), Vala (valac), Visual Basic (vbnc), Kotlin (kotlinc), Swift (swiftc), Objective-C (gcc), Fortran95 (gfortran), Octave (octave-cli), R (R), ASM (nasm. sh), Rust (rustc), Scala (scalac), Python (pypy3), SQL (SQL) C++ (g++)
pintia.workspaceFolder 指定工作区文件夹的路径,以存储代码文件 ""
pintia.enableStatusBar 指定是否显示 Pintia 状态栏 true
pintia.editor.shortcuts 指定编辑器中的自定义快捷方式。目前仅支持 Submit, Test, Preview ["Submit","Test", "Preview"]
pintia.paging.pageSize 当问题集过大时,是否对问题列表进行分页。当pageSize为0表示不分页 100
pintia.autoCheckIn 指定当 Pintia 插件被激活时,是否自动签到 Pintia 的教育商店 false
pintia.searchIndex.ignoreZOJ 指定搜索题目时,是否忽略 ZOJ Problem Set true
pintia.searchIndex.ignoreLockedProblemSets 指定搜索题目时,是否忽略未解锁的题集 true
pintia.searchIndex.autoRefresh 指定是否在插件被激活时,自动刷新题目搜索索引 false
pintia.autoCreateProblemSetFolder 指定创建题目源文件时是否自动创建其习题集文件夹并将源代码文件放入相应的文件夹中 true

4. 需要帮助?

在遇到任何问题时,您可以先查看故障排除常见问题

如果问题仍然无法解决,可随时创建一个新的Issue

5. 更新日志

请参考 CHANGELOG | 英文文档

6. 鸣谢

  • Pintia Extension 的功能设计参考了 LeetCode

vscode-pintia's People

Contributors

jinzcdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vscode-pintia's Issues

g++编译断开

由于codenow创建的文件题号和题名有空格导致g++编译找不到文件

无法加载题库

搜狗高速浏览器截图20240224224951
提示如下:
[INFO] Read the user session from the "C:\Users\BlackCat.pintia\user.json"
[HTTP Get] https://pintia.cn/api/u/current
[INFO] Read the cache of dashboard from the "C:\Users\BlackCat.pintia\cache\dashboard.json"
[INFO] Read the cache of problem sets from the "C:\Users\BlackCat.pintia\cache\problemSets.json"
[HTTP Get] https://pintia.cn/api/problem-sets/14/problem-summaries
[HTTP Get] https://pintia.cn/api/problem-sets/14/exam-problem-list?problem_type=CODE_COMPLETION&page=0&limit=200
[INFO] Refetching user's exams
[HTTP Get] https://pintia.cn/api/problem-sets/14/exam-problem-status
Error: examStatus is undefined

关于题目集

是否可以完善一下题目集的功能,使拓展界面可以显示并进入网页版中的“我的题目集”中的内容

非常感谢您开了PTA的做题插件,但是我在使用

但是我在使用过程中,无法submit,提示无操作权限
image

[INFO] Read the usersession from the "/Users/night/.pintia/user.json"
[HTTP Get] https://pintia.cn/api/u/current
[INFO] Read the cache of dashboard from the "/Users/night/.pintia/cache/dashboard.json"
[INFO] Read the cache of problem sets from the "/Users/night/.pintia/cache/problemSets.json"
[INFO] Read the problem list from the "/Users/night/.pintia/cache/1298273728383766528/PROGRAMMING.json"
[INFO] Refetch user's exams
[HTTP Get] https://pintia.cn/api/problem-sets/1298273728383766528/exams
[HTTP Get] https://pintia.cn/api/problem-sets/1298273728383766528/exams
[HTTP Get] https://pintia.cn/api/problem-sets/1298273728383766528/exam-problem-status
[INFO] Read the problem detail from the "/Users/night/.pintia/cache/1298273728383766528/1298273797619142705.json"
[INFO] Clear the cache from the "/Users/night/.pintia/cache"
[HTTP Get] https://pintia.cn/api/problem-sets/1298273728383766528/problems/1298273797619142705
[HTTP Get] https://pintia.cn/api/problem-sets/1298273728383766528/exams
[HTTP Get] https://pintia.cn/api/problem-sets/1298273728383766528/problems/1298273797619142705
[INFO] Read the problem detail from the "/Users/night/.pintia/cache/1298273728383766528/1298273797619142705.json"
[HTTP Get] https://pintia.cn/api/problem-sets/1298273728383766528/exams
[HTTP Get] https://pintia.cn/api/problem-sets/1298273728383766528/exams
[HTTP Post] https://pintia.cn/api/exams/1556613598733283328/submissions
{"details":[{"problemId":"0","problemSetProblemId":"1298273797619142705","programmingSubmissionDetail":{"compiler":"GCC","program":"\n\n123"}}],"problemType":"PROGRAMMING"}
{"code":"PERMISSION_DENIED","message":"无操作权限"}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.