Giter Site home page Giter Site logo

pygiftparser's People

Contributors

pipeknight avatar rgmf avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pygiftparser's Issues

Scape character.

The parser doesn't work with escape character () to escape lexical characters.

Question in multiple lines.

GIFT files can has multiline questions like this:

[html]¿Qué elemento de red representa el siguiente símbolo?
<br>
<img width\="200" src\="https://3.bp.blogspot.com/-oEMazpptpR8/UWOET9aDYgI/AAAAAAAAAH0/XZFW7gxWrgI/s1600/Cisco-Router-Commands-images.jpg"/>
{
	=%100%Router
	=%100%Enrutador
}

Like you can see, open brace can begin in the line just below the question and the question has more than one line.

Scape characters.

Space characters have to be removed from string questions and answers.

Error question reference.

When you import several files and there is an error in one of them then the question reference is wrong.

For example, in a file a.txt there is an error in question 3 but when you import several files like a.txt, b.txt and c.txt, for instance, then the parser informs the error is in question 85 instead of 3, for example.

Bad reference worng parsed question.

In this example:

Está bien {}

Está bien

Este está mal {

Está bien {}

The error is: Syntax error at 'Está bien ' in question number 3.

So the number of question is good, 3, but not the context text "Está bien".

General feedback field not supported

Hi, thanks for your work, I tried to use this library for playing with different quiz formats and I discovered that not it doesn't support "general feedback" option for questions. Link to docs:
https://docs.moodle.org/400/en/GIFT_format#Format_symbols
####general feedback

In the quiz, it looks like this:

// question: 47  name: Algebraic Expressions
::Algebraic Expressions::[html]<p dir\="ltr" style\="text-align\: left;">Rate your knowledge on Algebraic Expressions</p>{
	=<p dir\="ltr" style\="text-align\: left;">5</p>
	=<p dir\="ltr" style\="text-align\: left;">4</p>
	=<p dir\="ltr" style\="text-align\: left;">3</p>
	=<p dir\="ltr" style\="text-align\: left;">2</p>
	=<p dir\="ltr" style\="text-align\: left;">1</p>
	####<p dir\="ltr" style\="text-align\: left;">Thanks for answer!</p>
}

And now it is parsed like this:

(=) Option: <p dir\="ltr" style\="text-align\: left;">5</p> [1.0]
(=) Option: <p dir\="ltr" style\="text-align\: left;">4</p> [1.0]
(=) Option: <p dir\="ltr" style\="text-align\: left;">3</p> [1.0]
(=) Option: <p dir\="ltr" style\="text-align\: left;">2</p> [1.0]
(=) Option: <p dir\="ltr" style\="text-align\: left;">1</p> [1.0] (###<p dir\)
(=) Option: "ltr" style\="text-align\: left;">Thanks for answer!</p> [1.0]

[HTML also seems to be not supported straight out of the box, but I roughly fix it after parsing. Maybe better to fix it in preprocessing, but it's not so easy]

This seems like not a big issue, but I'm stuck with adding new regexp or modifying existing ones. Could you help me?

C

command python -m unittest discover -v -s tests/.

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.