2

I'm writing a multiple choice test program for teachers. The formula for the marks is:

(points awarded) / (maximum score) * 5 + 1.

This gives a mark in the range [1,6].

Now I want to add a scripting language, with which a teacher can define the formula for the mark him/herself.

Assuming the teacher is a person that doesn't know a lot about programming, which programming language would be the best choice to integrate as scripting language (from the standpoint of simplicity of use)?

Some of the possible choices are:

  • JavaScript
  • Python
  • Lua
  • VB.NET
  • C#
  • Ruby
  • Vala

My natural tendency would be towards JavaScript or Python. However, I am a bit wary as those 2 languages are case-sensitive programming languages.

The only case-insensitive option I am aware of would be VB.NET. Are there any other good choices?

anton.burger
  • 5,637
  • 32
  • 48
Stefan Steiger
  • 78,642
  • 66
  • 377
  • 442
  • 1
    There's always AppleScript. Anyone written a .NET parser for that yet? :-) – Cody Gray - on strike Apr 03 '13 at 06:06
  • 3
    This question might be a little subjective... is there any way "simplest" could be narrowed down a bit? – summea Apr 03 '13 at 06:08
  • 2
    See also: [Scripting language for embedding into C#/.NET applications?](http://stackoverflow.com/q/462311), [What is the best scripting language to embed in a C# desktop application?](http://stackoverflow.com/q/137933), [Scripting Language in a Sandbox for a C#/.NET Application](http://stackoverflow.com/q/564357), [.net scripting languages](http://stackoverflow.com/q/3997911), – Cody Gray - on strike Apr 03 '13 at 06:11
  • 6
    This never works. The user doesn't understand or forget how to do it, so you get a phone call. Then you curse yourself for inventing yet another scripting dialect and wish you'd just hardcoded and parameterized it. – CodeCaster Apr 03 '13 at 06:11
  • @CodeCaster: You confirm my worst fears ;) – Stefan Steiger Apr 03 '13 at 07:07
  • 1
    What about [Ook!](http://esolangs.org/wiki/Ook!)? Even monkeys are able to understand it ^^ – Carsten Apr 03 '13 at 07:08
  • Do you *need* a scripting language, or do you just need a way for a user to define a formula? – Damien_The_Unbeliever Apr 03 '13 at 07:20
  • https://github.com/patriksvensson/arithmetica – Patrik Svensson Apr 03 '13 at 07:42

1 Answers1

3

Why do you need a whole programming language to calculate the mark?

Simply use your programming language of choice to create a nice interface where the teachers have some flexibility.

You could for example have a simple input and allow the teachers to enter in some variable you've already defined, maybe $points and $max_score as well as a few basic math operators (*/-+) and then you can read the input and interpret it.

Alternatively you could use drop downs and other control to have a finer level of control, the options here are really only limited by your imagination.

Drew Khoury
  • 1,370
  • 8
  • 21