Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 4:59 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Regular Expressions in Opus?
PostPosted: February 23rd, 2005, 9:28 pm 
Offline

Joined: November 3rd, 2004, 2:11 pm
Posts: 323
Can Opus as exported with Flex handle regular expressions?

I have text entry fields in a mastery test where I need to be able to accept a fairly wide range of answers (especially if a word is misspelled).

Thoughts?

_________________
Opus Pro XE 9.1 Win7 64-bit Core i3 8MB RAM


Top
 Profile Visit website  
 
 Post subject: Use SELECT - CASE feature
PostPosted: February 24th, 2005, 3:46 pm 
Offline

Joined: October 25th, 2004, 2:20 pm
Posts: 686
Location: Naperville, Illinois (USA)
Opus: 7.05
OS: Win XP SP3
System: P4 3.2GHz 1GB RAM 2-TB HDs + 4 more
Brian --

Rather than just using an "If" statement to check for a correct answer, I'd suggest using the SELECT and CASE feature of OPUS. Your first CASE would be the correct answer, then you could have other cases in which you try to quess the most common misspellings of the correct answer (all of which you would "accept").

SELECT - CASE is a very power tool, which also allows you to respond differently to different incorrect responses. For example, if the answer should be "100" you could have responses like "you're getting close" if the student guessed between 90 and 99, or "that's too high" if they answer over 100. It's a much more elegant response system than just indicating the answer is "wrong."

_________________
Fred Harms, Extraordinary Demos
Naperville, Illinois (USA) 630/904-3636
demofred@aol.com


Top
 Profile Visit website  
 
 Post subject:
PostPosted: August 31st, 2006, 11:33 am 
Offline

Joined: January 19th, 2005, 5:15 pm
Posts: 83
Location: Netherlands
Just a little kick to this topic :

Is there any way to use regular expressions in Opus ?
In need a elegant script to remove html tags from a string. The nicest way to do this is with regular expressions, i think.

Thanks!


edit: my current solution is the following, but it think sometimes it will strip to much...
edit2 : changed script. I used break to exit loop, but this exits function too.

Code:
function strip_tags(input)
{
   var value = input;
   // loop till no more brackets
   while (true)
   {
      // find first <   and second
      var first  = value.indexOf('<', 0)
      if( first  == -1 )   return value;
      var second = value.indexOf('>', first)   
      if( second == -1 )   return value;
      
      // now strip all between first and second.
      var value = value.substring( 0, first) + value.substring( second+1);
   }
   return value;
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 43 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group