Git Product home page Git Product logo

lpn's People

Contributors

anniepoo avatar janwielemaker avatar jobos avatar nicoabie avatar paulbrownmagic avatar pmoura avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

pmoura

lpn's Issues

Don't use top-level shortcuts as directives

Instead of:

lpn/www/book/book.lgt

Lines 1 to 3 in 09a818b

:- {'chapters/chapters'}.
:- {'chapters/chapter1/chapter1'}.
:- {'chapters/chapter2/chapter2'}.

is preferable to write:

:- initialization((
    logtalk_load('chapters/chapters'), 
    logtalk_load('chapters/chapter1/chapter1'), 
    logtalk_load('chapters/chapter2/chapter2')
)).

or:

:- initialization(
    logtalk_load([
        'chapters/chapters', 
        'chapters/chapter1/chapter1', 
        'chapters/chapter2/chapter2'
    ])
).

How can i insert images?

I'm translating chapter 3 of learn prolog now. It has several images, how can i add them into the code?
P.s. as soon as i finish a will push a PR.

Optimize random_id/1 predicate

The random_id/1 predicate defined as:

random_id(ID) :-
length(Codes, 12),
maplist(random_between(97, 122), Codes),
maplist(char_code, Chars, Codes),
atomic_list_concat(Chars, ID).

can be rewritten for better performance as:

random_id(ID) :- 
     length(Codes, 12), 
     maplist(random_between(97, 122), Codes), 
     atom_codes(ID, Codes).

Possible optimization for the children/2 predicate

The children/2 predicate is currently defined as:

children(N, Children) :-
current_object(N),
N::current_predicate(children/1),
N::children(Children).

The downside of this definition is that the call to the current_object/1 built-in predicate will enumerate all loaded objects. If the objects actually implementing the children/1 predicate are redefined to implement a marker protocol, then the children/2 predicate definition could be simplified to:

children(N, Children) :- 
     implements_protocol(N, marker_protocol),
     % or, if the object inherits the protocol from an ancestor
     % conforms_to_protocol(N, marker_protocol),
     N::children(Children).

This simplified version does assume that there will be no categories implementing the protocol.

Drag and Drop Quizzes

In Quiz '2.3.4' it would be nice to have a drag and drop sortable list with a bin for results that aren't returned. This could be achieved using a jQuery library like sortable, or a HTML5 alternative.

It's likely that this will be useful with non-ordered things too, it could provide a nice alternative to MCQ's.

To do this will require a new subclass of question_quiz in /www/book/quizzes.pl, and a new JavaScript and optional Tau-Prolog auto-marker.

Faster init/0 implementation

The init/0 predicate currently defined as:

init :-
findall(I, get_by_type(radio, I), Inputs),
maplist(bind_click, Inputs).

can be rewritten for better performance as:

init :- 
     forall(get_by_type(radio, Input), bind_click(Input)).

Editor Component

For quizzes such as 2.3.7 it would be nice to have an in-built editor. This would be a multi-step project.

  1. First we'll need an editor and query mechanism similar to the interactive content. It should autoload useful libraries like lists.
  2. Then it would be great if we could parse errors to give friendly feedback.
  3. Then it would be great if we could give it tests that can generate exercise specific feedback.
  4. Finally it would be great if we could give it tests to determine that the exercise has been completed.

It would also be useful to provide an example solution tab. When we integrate user accounts, we could also store a user's code for them, alternatively, we could hand this off to SWISH if we don't have user accounts.

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.