Import issues: hidden word, HTML, and java....

Import issues: hidden word, HTML, and java....

by D.I. von Briesen -
Number of replies: 9
Folks- Looked around a bit and found few answers, so here goes:
I'm program chair of Internet technologies, teaching web design, internet protocols, java, and some others. In the process of using moodle, i've been migrating many exams from formats as diverse as webpages and pdf. It's easy enough to manipulate to get them into text format, but what I'm finding is that the missing word format is more cumbersome than a freebie I'd been using for blackboard. Specifically, the addition of ~ and {} makes it harder to format than simply adding a * to each right answer - which is what I was doing. It was flexible enough to do true/false, multiple choice, missing word, checkboxes, etc... and when I needed to edit hundreds of questions I just added the * to the right answers. It ignored numbers and letters (1), a. a), etc.. before questions.

The missing word format requires a lot of creative find-and-replace in word, which makes life trickier. Also, in both html and java, there are a lot of  equals (=) signs, and they threw me for a huge loop, breaking out formulas into multiple answsers unexpectedly. The html was a bigge, where I had a question with a textarea tag - it imported it, and then EVERYTHING ON THE PAGE after it was INSIDE the textarea form field as html. Funny, until 2 hours later when I figured out how to find the code that id'd the confirmation of how to delete it.

So two-fold question:
1) how do I deal with java equations that have = in them, and html that has tags in them (both when importing, not creating one at a time - although I think that's an HTML problem too
2) is there a format out there that simply uses carriage returns to deliniate questions or something simpler than missing word. (I believe the logic was just that a blank line separates questions, the first item is the question itself, and subsequent items without * are wrong, with * are right - and where points apply they are distributed across right answers.

Thanks bunches!!

d.i.
Average of ratings: -
In reply to D.I. von Briesen

Re: Import issues: hidden word, HTML, and java....

by D.I. von Briesen -
Interestingly, the site of the original generator seems usually to be entirely broken: I've found a cached example on google as follows: I suspect this would be very easy for some of you php-heads out there to do. I know nussing about PHP at present, and have to direct my immediate time to fixing all those java tests I imported....black eye

Example

I want to create a multiple-choice series of questions. I type:
1. What was the first name of the Bloom who invented Bloom's Taxonomy?
a. Harold
b. Alan
*c. Benjamin
d. David

2. Can Puerto Ricans who are U.S. citizens vote for president?
a. Yes
b. No
*c. Yes, if they live in another state

3. In addition to multiple choice, what other question formats does this work with?
*a. Multiple Answer
*b. Matching
*c. True-False
*d. Essay
*e. Fill in the blank
*f. Ordering
etc. Asterisk indicate correct answers. Notice that #3 has all the items with asterisks (because they're all right). More than one asterisk is all that's required to create a multiple answer format question (where there's more than one answer).
In reply to D.I. von Briesen

Re: Import issues: hidden word, HTML, and java....

by D.I. von Briesen -
Yet another post: In trying to get the first site to work, I stumbled upon another site, which either hired the same person, or stole the pages or was gifted them. Everything looks good. Particularly nice that you can have it insert samples of each type for you - so GREAT for beginners.

http://solomon.byui.edu/blackboard/default.html

Now before somebody embarrasses me (gears churn in skull... oil drips from nostril, smoke slowly comes from left ear, and eyelid begins to twitch), does this mean I could use this utility to make blackboard quizzes and then import them into moodle....?

d.i.
In reply to D.I. von Briesen

Re: Import issues: hidden word, HTML, and java....

by Paul Shew -
Did you take a look at the new GIFT import filter? (look in the CVS) It does a lot more than the missing word. And it's very easy to change the control characters to something other than ~ or =. It was not designed for importing HTML or JAVA, but you should be able to fairly easily modify it to your purposes.

You also might take a look at the Aiken format; it's close to the examples you wrote above.
In reply to D.I. von Briesen

Re: Import issues: hidden word, HTML, and java....

by Paul Shew -
Another solution is the change the equal sign and other special characters to their HTML entities:

~   --> ~
=   --> =
<   --> &lt;
>   --> &gt;

These also might be helpful:
{   --> &#123;
}   --> &#125;

See here for more:
http://www.bbsinc.com/iso8859.html
http://www.htmlhelp.com/reference/html40/entities/
In reply to Paul Shew

Re: Import issues: hidden word, HTML, and java....

by D.I. von Briesen -

Mr. Shew:

Thanks for your input! I guess I've got a number of issues here-

For starts, I've taken your custom format and asked our admin guy to upload it (this afternoon, actually). I'm waiting to hear and test. I'm reluctant to get into editing the code without really be willing to get into it, since I don't have admin rights, and the round trip on development could get cumbersome, esp. without me knowing what I'm doing.

I'll check out the aiken format- got any links to that?

On the substitute characters, I actually tried that - but what happened is even when the import went well, Moodle freaked out as described when I DISPLAYED the question (in the question title, no less) so I couldn't even access the delete question X link. So it's as if it's being converted to true html from display html somewhere along the line. It's possible that I'm missing something obvious - but when I manually edited it to include the &gt; I ran into the same problem.

On the curlies {} it's not so much needing special characters, as it being more work to put them in. Imagine you've got 500 questions (and I do, by 5 classes) so one wants easy ways to convert them to the appropriate text format- easy in my case seems to be minimal additional characters- and a ~ before each answer is actually more work than I expected.

Hopefully I'll get your custom.php in and see how it goes - but still worried about the java... then again, maybe that & sub will work for that... but how do I get it NOT to apply to the correct answers when I do the find and replace....?

d.i.

In reply to D.I. von Briesen

Re: Import issues: hidden word, HTML, and java....

by Paul Shew -
The new import filters (Aiken and GIFT) are in the latest development version and can be accessed through the CVS.
http://cvs.sourceforge.net/viewcvs.py/moodle/moodle/mod/quiz/format/

Quiz Help Files in CVS:
http://cvs.sourceforge.net/viewcvs.py/moodle/moodle/lang/en/help/quiz/
Take a look at formatgift.html, formataiken.html and import.html

As for the problem of not having an import format that matches your existing questions, my suggestion is to find an import filter that is most similar to your needs and edit it. If you don't have admin access on the production server, maybe you can set up your own installation of Moodle for testing. OR, you could write a Java script or Word macro to help automate editing the questions to use an existing filter.


HTML code in questions: On my own site, I tested quiz questions with HTML entities instead of < and > and it worked fine. For example I used the following code in a quiz question:
     &lt;b&gt;html entities&lt;/b&gt; <b>real tags</b>

and it displayed as follows:
     <b>html entities</b> real tags


Are you sure you didn't have some real html tags left in there somewhere?

In reply to Paul Shew

Re: Import issues: hidden word, HTML, and java....

by D.I. von Briesen -
While I"m reluctant to try and repeat it b/c of the headache it caused me, I'm pretty sure this really didnt' work. See what happens if you put the <textarea> tag in your question title (or the question, which becomes the title by default) .

I'll try and look into the formatting... it's one of those painful things where I'm weighing the time of manual work against development, and while I'd prefer the latter, the former is winning with each passing day...

Still no word from my admin...
d.i.
In reply to D.I. von Briesen

Re: Import issues: hidden word, HTML, and java....

by Paul Shew -
I tried using html entities on my system instead of real tags, and it worked fine. I tested both manually writing the question using Moodle's GUI, and importing from a text file. Both worked without a problem.

I used the following code for my question text and title:
&lt;textarea&gt;html entities&lt;/textarea&gt;
<textarea>real tags</textarea>


And it displayed without any problems exactly as intended (just like the example above).

I'm using Moodle version 1.1.1 with the latest version of the GIFT import filter from the CVS.
In reply to Paul Shew

Re: Import issues: hidden word, HTML, and java....

by D.I. von Briesen -

Argh. Oh well - maybe it was the weather. All I know is I did put the codes in there when manually trying to fix the problem, and it happened consistently. This was not with your filter (which BTW they are saying they'll install).

D.I.