MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   ePub (https://www.mobileread.com/forums/forumdisplay.php?f=179)
-   -   MCQ code (for Multiple Choice Question) in epub format (https://www.mobileread.com/forums/showthread.php?t=338202)

reinsley 03-21-2021 06:47 AM

MCQ code (for Multiple Choice Question) in epub format
 
Hello,

I am looking for an example of MCQ (for Multiple Choice Question) in epub format.
I have a weather forecast paper manual for gliding. It's a pity to not convert it to epub. I have no idea how to start this project and a piece of code will be appreciated to see throught Calibre.

Epub or mobi format example are welcome as I will read it on a Kindle. The format conversion could be an issue.

Thank you for any help and good idea.

Best regards

fbrzvnrnd 03-21-2021 09:31 AM

Quote:

Originally Posted by reinsley (Post 4104756)
Hello,

I am looking for an example of MCQ (for Multiple Choice Question) in epub format.
I have a weather forecast paper manual for gliding. It's a pity to not convert it to epub. I have no idea how to start this project and a piece of code will be appreciated to see throught Calibre.

Epub or mobi format example are welcome as I will read it on a Kindle. The format conversion could be an issue.

Thank you for any help and good idea.

Best regards

If you are talking about a form with questions and a score for the user, you cannot do this on Kindle or ePub2, you have to use EPUB3 and write some code in javascript. Or, in kindle formats and ePub2, you can create something similar to a tree structure where the wrong question brings to a dead end, and the correct one brings to another question (like a "choose you own adventure"). But you can not stop a user from turn a page and "jump" in another random place of the tree: you can not really create a "dead end" in ePub or Kindle (sigh).

reinsley 03-21-2021 01:45 PM

Thank so much for your help.
I am looking for your second option. A "choose your own adventure".
A good answer brings you to another new question.
A bad answer brings you to revise and reread a chapter or an explanation you did not get it.

It's a tutorial, if the reader wants to cheat, too bad for him.
If I could restart from the last entry of the last session, it will be a plus.
These points are cosmetic options as the main thing is the whole structure. Texts, images ( clouds' photos, diagrams, patterns...) and links to go to the next question or to force to read the not well understood point.

fbrzvnrnd 03-21-2021 02:48 PM

Quote:

Originally Posted by reinsley (Post 4104878)
Thank so much for your help.
I am looking for your second option. A "choose your own adventure".

So, the code is quite simple: link. Every item is a link to a "chapter". Every chapter (my suggestion) a different file.
In the "right answer" chapter you will create another form with questions and so on.

The tag for link is <a href="nameofthefile">answer</a>.

This an example from a ebook "choose your own adventure" I created:

Code:

    <body>
<div id="t24" class="stanza">
            <h2 class="sigil_not_in_toc">Un enorme masso scuro</h2>
            <p>A fatica raggiungi la base di questo masso che si erge eretto come un monolite primitivo. L'umidità ha favorito la crescita di <a href="mens_0029.xhtml">rampicanti e felci</a> che coprono buona parte della roccia.</p>
            <p>Alzando gli occhi, <a href="mens_0008.xhtml">torni a guardarti attorno</a>.</p>
        </div>
</body>


reinsley 03-22-2021 06:27 AM

I appreciate your help.
Thank you very much.

Quoth 03-22-2021 07:58 AM

Or add an anchor/bookmark in the source file at the destination start of paragraph, and then the URL for that is prefixed with # on each answer link.

fbrzvnrnd 03-22-2021 09:09 AM

Quote:

Originally Posted by Quoth (Post 4105115)
Or add an anchor/bookmark in the source file at the destination start of paragraph, and then the URL for that is prefixed with # on each answer link.

Yes, in this case you also have to split the ebook in different files and transform internal link to external to be sure the answers will appear on different pages (Sigil does this).

Quoth 03-22-2021 10:24 AM

Or simply use a style with Page Break Before in the Wordprocessor at the start of each answer. Don't make it a heading style unless you want it in the TOC.

I've never needed to explicitly decide file breaks. Calibre does it fine with a properly styled DOCX as input source.

There was originally in Mobi, recognised by Mobi creator if you used HTML source, a tag that meant don't page past here, so you COULD make parts of the ebook accessible only via links. I tested this years ago with MS Word 2002 on XP:
1) Export as HTML*
2) Clean ghastly MS generated HTML
3) Add the no page tags.
4) Import into Mobi Creator.

At the time I only had a Mobi viewer for XP, which I read gutenberg on. No suitable smart phone, tablet or eink till years later. I gave up on the idea of doing the Plot Your Own Adventure because there was no mechanism to score. A Client Side HTML image map would have been nice too. Crazy that epub2 and KF8 never added it.

* Back then OpenOffice Writer generated better / cleaner HTML. But import of MS Word wasn't great then. Import of doc or docx to LibreOffice Writer today depends on how insane the Word doc formatting is. LO does better HTML and PDF than Word2007, but Sigil or Calibre make better epub2 than the LO plugin or built in.

fbrzvnrnd 03-22-2021 11:25 AM

Quote:

Originally Posted by Quoth (Post 4105170)
Or simply use a style with Page Break Before in the Wordprocessor at the start of each answer. Don't make it a heading style unless you want it in the TOC.

Ok, I don't use WP, so I do it directly in XML.

Quote:

Originally Posted by Quoth (Post 4105170)

I've never needed to explicitly decide file breaks. Calibre does it fine with a properly styled DOCX as input source.

In ePub2 I usually work on a single large XHTML file with internal links. It is faster for editing. When all is ready, I use Sigil to split the single sections. Usually. For some works the author created a software to do this. One of our ebooks has 5000 locations with 11.000 internal links, so it is better automatize this job.

Quote:

Originally Posted by Quoth (Post 4105170)

There was originally in Mobi, recognised by Mobi creator if you used HTML source, a tag that meant don't page past here, so you COULD make parts of the ebook accessible only via links

I know... and I tested it a lot, but the support on Kindle was poor. There is another way to do it on ePub, and I build an ebook using it: create an ebook with the first page as linear="yes" and the rest of the book with linear="no". It works... but only with some software, so I published it as "experiment". iBooks for example creates a web page (!) for the linear="no", so it is not readable on iBooks.

Quote:

Originally Posted by Quoth (Post 4105170)

Crazy that epub2 and KF8 never added it.

The big problem is the book: all the e-book formats give you the tools to create a analogic-book-in-digital instead of a digital one.

f.

reinsley 03-23-2021 02:04 PM

Gents,

I started a test epub. I did not imagine the structure it would take.
Obviously, with your experience, you anticipate all the sensitive points.

For the page break, I will probably use :

Into stylessheet.css :
.WordSection {
display: block;
page: WordSection1
}

or </br>, I will see.

For the score I could write a reminder of the questions total number in the theme or section. As the reader comes back to the sub-section as long he is wrong, he can see the progression, question4... question5...question6 out of ten. And a kind of progress bar with stars or something.
And a note could send some kind of popup message. It's still abstract for now, the simplier will decide.
WRONG leads again to the start of the question, CORRECT leads to the next question. And a link to go to the next sub-section as the reader could be trapped without exit.

I don't know if I can post into the forum my skeleton epub, in case anybody would like to comment...

I keep your precious advices about Export as HTML and also Sigil tools.
I use plugin Sigil to make links.

Best regards

fbrzvnrnd 03-24-2021 08:00 AM

Quote:

Originally Posted by reinsley (Post 4105555)
For the page break, I will probably use :

Into stylessheet.css :
.WordSection {
display: block;
page: WordSection1
}

Uhm, I do not understand what are you using to develope the ebook...

Thasaidon 03-24-2021 08:13 AM

Quote:

Originally Posted by reinsley (Post 4104878)
Thank so much for your help.
I am looking for your second option. A "choose your own adventure".
A good answer brings you to another new question.
A bad answer brings you to revise and reread a chapter or an explanation you did not get it.

It's a tutorial, if the reader wants to cheat, too bad for him.
If I could restart from the last entry of the last session, it will be a plus.
These points are cosmetic options as the main thing is the whole structure. Texts, images ( clouds' photos, diagrams, patterns...) and links to go to the next question or to force to read the not well understood point.

I loved this kind of tutorial when I was younger in pBook form. I also loved the "choose your own adventure". when they appeared.

Some "choose your own adventure" books have definitely been turned into ebooks. I have one or two so it is definitely possible and from cleaning up the code, they are not particularly difficult to code.

reinsley 03-24-2021 10:47 AM

Quote:

Originally Posted by fbrzvnrnd (Post 4105720)
Uhm, I do not understand what ...

Er ! you are right, it does not work.
I used to store a chapter in a single html file.
So the page jump is automatic.
In this case it makes too many html files.
I should have 10 html files for questions, and 10 html files for answers.
And a page jump after each question to display only one question at a time.
I have to do my homework.

I use Calibre and sometimes Sigil for the links automation.
Another minor thing. The Calibre convertion epub to azw3 does not keep my links.

To evaluate the job : 10 chapters, 515 questions with 3 or 4 MCQ for each, it means about 1800 choices ( links), and 10 MCQ final test for each chapter ( about 150 questions with 8 to 25 choices) it means about 2200 choices ( links).

The automation with Sigil's plugin Footnotelinker is useless. The 4000 links or more must be build by hand. Some line should have two links.

I have a better view of the job. Even if I don't know how to do it for some points.

fbrzvnrnd 03-24-2021 10:53 AM

Quote:

Originally Posted by reinsley (Post 4105748)
Er ! you are right, it does not work.
I used to store a chapter in a single html file.
So the page jump is automatic.
In this case it makes too many html files.
I should have 10 html files for questions, and 10 html files for answers.
And a page jump after each question to display only one question at a time.
I have to do my homework.

I use Calibre and sometimes Sigil for the links automation.
Another minor thing. The Calibre convertion epub to azw3 does not keep my links.

To evaluate the job : 10 chapters, 515 questions with 3 or 4 MCQ for each, it means about 1800 choices ( links), and 10 MCQ final test for each chapter ( about 150 questions with 8 to 25 choices) it means about 2200 choices ( links).

The automation with Sigil's plugin Footnotelinker is useless. The 4000 links or more must be build by hand. Some line should have two links.

I have a better view of the job. Even if I don't know how to do it for some points.

The wrong answers link to a standard "wrong page" or there are informations about the error?

reinsley 03-25-2021 02:32 PM

Quote:

Originally Posted by fbrzvnrnd (Post 4105750)
The wrong answers link to a standard "wrong page" or there are informations about the error?



Good question. Just a recap of the answer and the word Correct or Wrong.
What I did : one question with 4 MCQ and 4 links towards the 4 answers. The correct A has a link to the next question.
The 3 wrong A have the same texte and the same link to comeback to the same question.
I could simplify.
One good A links to the next step and one text only for the wrong 3 answers with the same link.

I discover a strange thing. The links are ok now but the popup footnote does not work anymore. I jump to the Answer.html, it's not easy to read as I see the full texte.
I have to restart with the footnote links that display one answer only. This is the equivalent to display a endnote at a time.


I found a guide : Kindle Publishing Guidelines : How to make books available for Kindle devices and applications
I have to dig inside, it may help.

By the way, the conversion epub to azw3 keeps the links.
The pagebreak works fine and is done with
.pagejump {
page-break-before:always;
}
If I convert epub to epub, Calibre kills my page, swallows the pagebreak and it splits the page in little chapter.html as many as it meets a page break.

Not so simple but its a good training.


All times are GMT -4. The time now is 08:10 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.