Coder Social home page Coder Social logo

testmyqt / qt-creatortmc Goto Github PK

View Code? Open in Web Editor NEW
0.0 5.0 1.0 2.03 MB

Qt Creator plugin for TestMyCode (TMC) at University of Helsinki

Home Page: https://testmycode.github.io

License: GNU Lesser General Public License v3.0

C++ 94.50% QMake 5.50%
testmycode qt-creator tmc

qt-creatortmc's Introduction

Qt-CreatorTMC

Build Status

Note: Currently the most up-to-date branch is not master, checkout tqc-tmc

Building the plugin by yourself (Linux)

  1. Install Qt Creator download.qt.io if you haven't got it already.
  2. Get the sources for the Qt Creator build from code.qt.io
    • git clone git://code.qt.io/qt-creator/qt-creator.git
  3. Qt Creator is released from tags, like 'v4.8.0-beta2', so checkout the right Qt Creator version tag:
    • git checkout v4.8.1
  4. Clone this repository recursively: git clone --recursive https://github.com/testmyqt/qt-creatortmc
    • 3rdparty contains sources for dependencies that are statically-linked to the plugin shared object file: quazip and zlib
  5. The project can be opened in Qt Creator now. To configure the build target set the following environment variables:
    • To set environment variables in Qt Creator, go to Projects Mode -> Build -> Build Environment
    • QTC_BUILD your Qt Creator build
    • QTC_SOURCE your Qt Creator sources
  6. Build the project. The plugin will be located in QTC_BUILD/lib/qtcreator/plugins/libTestMyCode.so
  7. Restart Qt Creator to load the plugin.

Development setup

If you wish to develop the plugin, you might want a setup with a second instance of Creator. One way to accomplish this is to build Creator by yourself.

  1. Get the sources for the Qt Creator build from code.qt.io
    • git clone git://code.qt.io/qt-creator/qt-creator.git
    • cd qt-creator
    • Qt Creator is released from tags, like v4.8.0-beta2, so checkout the right Qt Creator version tag:
    • git checkout v4.8.0-beta2
    • Note: You will need a debug build if you want to debug your project
  2. To build Qt Creator in to a separate build directory:
    • mkdir ../qt-creator-build && cd ../qt-creator-build
    • qmake ../qt-creator
    • make or make -j $(nproc) to build on all cores
  3. Clone this repository recursively: git clone --recursive https://github.com/testmyqt/qt-creatortmc
    • 3rdparty contains sources for dependencies that are statically-linked to the plugin shared object file: quazip and zlib
  4. The project can be opened in Qt Creator now. To configure the build target set the following environment variables:
    • To set environment variables in Qt Creator, go to Projects Mode -> Build -> Build Environment
    • QTC_BUILD your Qt Creator build
    • QTC_SOURCE your Qt Creator sources
    • BUILD_OUTPUT_PATH where the shared library file will be located. If not set, will install to QTC_BUILD dir.

Linux

  • Debug build qmake -spec linux-g++ CONFIG+=debug
  • Test build qmake -spec linux-g++ CONFIG+=test
  • Run make to build
  • Run make install to install the plugin .so file to the plugin directory

To run the plugin/IDE, you need to create a Run configuration to launch the QTC_BUILD, Projects Mode -> Run. It is recommended to add the additional command line argument -settingspath path-to-temporary-settings to not run in the same creator session as your development environment.

Generating QDoc

The QDoc configuration file is main.qdocconf in the root directory of the project. The QDoc documentation is automatically generated into doc/html by running the command qdoc main.qdocconf. Note that each time the command is run, all the previous content of doc/html is deleted. So don't place any manually generated content into the directory!

qt-creatortmc's People

Contributors

d471061c avatar kimmoal avatar nucularmoo avatar razumihin avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

razumihin

qt-creatortmc's Issues

Do not overwrite student files from exercises

When updating the update should not overwrite student edited files. Probably comparing the hash values of the new files against the old ones or overwriting all files except the StudentFilePolicy defined files in src directory.

Submission cancelation

Should the student close the submit widget or should it persist until results are ready?

TmcClient hardcoded API URL

Make API endpoint URL a setting in TmcClient, for example:
API_BASEURL = "https://tmc.mooc.fi/api/"
...
QUrl url(QString(API_BASEURL + "v8/core/exercises/%1/download").arg(ex->getId()));

Download panel starts and persists despite no download

Scenario:

My download/update exercises list is empty or completely unticked and I press "OK" to "download exercises" (but am actually downloading nothing) (instead of "cancel" to just close the window).

Problem:

The download panel window pops up and persists until manually closed as there is nothing being downloaded so it does not close on it's own.

Replace TMC with autotest

In the future the plugin needs to talk to the autotest plugin to get test information. Currently autotest needs modification to expose the parts to other plugins.

How do we set up TMC-cli for the end user

When the user installs and wants to use our plugin TMC-cli is required for the TMC testing to work.
Within the code this requires the plugin to know where to find TMC-cli (the jar).
How will TMC-cli be distributed, how will the plugin know where to find TMC-cli on the users computer (will there be a settings window for this for the user to set it up?).

Popup for notifying the user of exercises that can be updated

If we continue on the idea of adding icons into the TMC results pane bar, could add icon for updating exercises that would normally be grayed out, but color up when there are updates to be downloaded.
As the plugin will occasionally poll for updates and when the updates are available, a small popup would be nice to inform the user that there are exercises to download.
However the popup should not become active as in steal your cursor and should more be a notification type that will allow the user to update/dowload exercises (to not interfere with the user workflow)

Write metadata to QSettings

For example, exercise data is not written to disk to persist editor reboot. We also need to invalidate the metadata on disk when updates are downloaded etc.

tmc-server error handling

TmcClient does not handle TMC errors very nicely. When deadline has passed you get 401 and
"{"error":"Submissions for this exercise are no longer accepted."}" as the error, but this is not displayed. Need to refactor tmcclient to handle these error messages properly.

TMC Qsettings on Windows are stored in registry and not a file

Configured as is we are unable to locate a .conf or .ini file with the TMC server, user etc settings on Windows. The Qsettings are stored in the registry at HKEY_CURRENT_USER -> SOFTWARE -> TestMyQt -> TMC (as this seems to be the default option on Windows if no output file or path is specified).

This is not user friendly in the case of wanting to reset/tweak settings and should be reworked so the settings are stored in a separate defined file (most likely placed under the directory /Users/<user>/%APPDATA%/Roaming/TestMyQt) that can be referenced in documentation.

Removed exercises are not invalidated correctly

Scenario:

Started Qt Creator, downloaded exercises, exercises open (automatically), closed exercises in Qt Creator, deleted exercises from my hard drive.

Problem:

When trying to download exercises again, the download/update exercises list offers me an empty view, and I am required to restart the IDE for the exercises to show up in the download/update window so I can redownload them.

Open downloaded projects

Downloaded projects are opened automatically, but they are not autoconfigured so the user needs to configure them manually. This could be tedious, so maybe autoconfigure them with some sane default (or make it a settings).

Deadline management

  • Deadlines need to taken into account (user should not be able to submit an exercise past the deadline).
  • Case of changed deadline: Exercise data is only updated if the checksum is changed. If (find out if) the changed deadline alone doesn't change the checksum, some other way to update the deadline needs to be implemented.

Popup window positioning

Can we please default the popup windows as follows:

download progress bar window - lower right of IDE window (but not entirely down in the corner, pad with maybe 5-10% of width and height of IDE window)

Download exercise window - upper right of IDE window (but not entirely up in the corner, pad with maybe 5-10% of width and height of IDE window)

Login/Settings window - smack dead in the upper middle (but not entirely in the upper area, pad with maybe 5%)

TestMyCode menu sporadically becomes invisible in Windows

Sometimes the TestMyCode menu (and sometimes, other menus alongside it) becomes invisible (goes to the background/loses it's frame layer and ends up "behind/under" the Qt Creator window) in Windows. Have not figured out how to reproduce, as it's (seemingly) occurring outside active use (I'm mostly screenshotting and alt-tabbing back and forth) of the plugin/IDE.

Strange linker behaviour on MacOS

I've had now two times that the project seemingly for no reason seems to link under MacOS and clang x64.

This second time the tests for the fifth assingment of the first part did not link with the main project and I got an error message about not finding the signal/slot implementations.

For some reason, commenting out the CONFIG -= app_bundle line from the tests fixed the problem. I tried to reproduce the error after I got it working by removing the comment, but it seems to link fine now.

So just a heads up if other people experience strange behaviour on MacOS.

Global settings object

Would be cleaner to have a global settings object that every object would have a reference to and appropriate signal slots connected.

Download exercises checklist

To me it would seem preferable that upon clicking "Download" and the list of exercises with respective checkboxes popping up, the checkboxes would all be ticked instead of unticked.
It seems more likely that when wanting to download exercises, the user downloading them would want to download them all?

Download/update exercises list empty when changing working directory

Scenario:

I have downloaded the exercises and change my working directory (for the exercises) in the settings.

Problem:

When trying to redownload the exercises into my new (empty) working directory, the offered download/update list is empty and will not offer me any exercises. This persists until I have deleted the old exercises and restarted Qt Creator.

Setting automatic updates off

Setting automatic updates to 0 should disable them, but currently it causes infinite updates until crash (it seems to disable it from the next launch on though).

User interface for using TMC

Idea of adding Test/Running tests locally/Submitting as buttons in the TMC results pane.
Should also add these to the TestMyCode menu, and concider adding atleast some of the TMC options as a right click option for the project pane when right clicking on a project.

Projects to exercise mapping

Open projects are now mapped to exercises with name only. They should be probably mapped with location on disk or some other unique identifier so we can be sure we are submitting the right project.

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.