/    Sign up×
Community /Pin to ProfileBookmark

Creating a random story based on input

Hello all,

I am a school teacher in Ontario, Canada. This year, I am helping quite a number of students at my school who are having trouble with reading. I would like to create a random paragraph generator based on their reading level and I thought I’d check here to see if it is even possible.

My idea is to have 6 categories that correspond to the reading skills being addressed. For each category, there would be 4 sets of sentences available, each set corresponding to the reading level.

For example, if Billy is at a level 2 in decoding digraphs, level 1 at decoding short vowel sounds, etc. I would put these levels in the corresponding boxes and click ‘Submit’. The generator would then use the scores to look at the lists under each of the six categories (digraphs, short vowels, etc.) and randomly select a sentence from the corresponding levels. It would then return a paragraph including all six sentences.

It would be even better if there was a way to personalize the sentences with the kids names and pronouns . . . (doesn’t hurt to ask 😉

Any input would be greatly appreciated. Thanks!

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@NoEffinWayOct 28.2013 — Yes, it is possible...but I would use more then just Javascript. Look into some server site scripting. I can help you with more detail if you would like, just PM me.
Copy linkTweet thisAlerts:
@greenflyauthorOct 28.2013 — I am not quite sure how to PM you . . . I tried creating a new message but I get some sort of error stating it cannot display the page. Can you PM me? Maybe I'll be able to reply to your message.
Copy linkTweet thisAlerts:
@vwphillipsOct 29.2013 — in principle

[CODE]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title></title>
</head>

<body>
<div id="catagory1" >
catagory 1<br />
<select onchange="zxcRandomSentence.Select('catagory1',this.value);">
<option >Select Level</option>
<option value="0" >Level 1</option>
<option value="1" >Level 2</option>
<option value="2" >Level 3</option>
</select>
<div></div>
</div>
<div id="catagory2" >
catagory 2<br />
<input type="radio" name="c2" value="0" onclick="zxcRandomSentence.Select('catagory2',this.value);"/>
<input type="radio" name="c2" value="1" onclick="zxcRandomSentence.Select('catagory2',this.value);"/>
<input type="radio" name="c2" value="2" onclick="zxcRandomSentence.Select('catagory2',this.value);"/>
<div></div>
</div>

<script type="text/javascript">
/*<![CDATA[*/

var zxcRandomSentence={

Select:function(id,n){
var o=this['zxc'+id];
if (o&&o.a[n]){
o.d.innerHTML=o.a[n][Math.floor(Math.random()*o.a[n].length)]
}
},

init:function(o){
var id=o.ParentID,a=o.SentenceArray,p=document.getElementById(id),d=p?p.getElementsByTagName('DIV')[0]:null;
if (d&&a instanceof Array){
o.d=d;
o.a=a;
this['zxc'+id]=o;
}
}

}

zxcRandomSentence.init({
ParentID:'catagory1',
SentenceArray:[
[
'catagory 1 level 1 sentence 1',
'catagory 1 level 1 sentence 2',
'catagory 1 level 1 sentence 3',
'catagory 1 level 1 sentence 4'
],
[
'catagory 1 level 2 sentence 1',
'catagory 1 level 2 sentence 2',
'catagory 1 level 2 sentence 3',
'catagory 1 level 2 sentence 4'
],
[
'catagory 1 level 3 sentence 1',
'catagory 1 level 3 sentence 2',
'catagory 1 level 3 sentence 3',
'catagory 1 level 3 sentence 4'
]
]
});

zxcRandomSentence.init({
ParentID:'catagory2',
SentenceArray:[
[
'catagory 2 level 1 sentence 1',
'catagory 2 level 1 sentence 2',
'catagory 2 level 1 sentence 3',
'catagory 2 level 1 sentence 4'
],
[
'catagory 2 level 2 sentence 1',
'catagory 2 level 2 sentence 2',
'catagory 2 level 2 sentence 3',
'catagory 2 level 2 sentence 4'
],
[
'catagory 2 level 3 sentence 1',
'catagory 2 level 3 sentence 2',
'catagory 2 level 3 sentence 3',
'catagory 2 level 3 sentence 4'
]
]
});


/*]]>*/
</script>
</body>

</html>[/CODE]
×

Success!

Help @greenfly spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...