text:
Lever Simulator 2015
Why a Simulator?
Kids these days don't have the time nor the ambition to actually go and stack boxes on the see-saw or play around with balancing physical objects. This leaves lots of room in the software market for a Lever Simulator which will, according to my models, sell like mad!
Programming Help Wanted
I've filed the patent for such a game (pending), but need an expert programmer to write the game-logic for me. From my understanding, it is standard practice to compensate programmers based on the size in bytes of the final program. As such I will be awarding this lucrative contract to the lowest bidder.
Specification
A lever is a series of boxes or empty spaces that is balanced by a fulcrum. Each box has a particular weight one through nine and spaces have no weight. As you know, a box's weight on the lever is directly proportional to how far that box is from the fulcrum. A box of weight 4 that is on the third space from the fulcrum will contribute 12 effective units of force to that side of the lever.
I need a program that, given an input lever, will output whether the lever will skew toward the left, the right, or be perfectly balanced.
I/O Guidelines

You will write for me a program.
The input will contain one line of text.
The input will come from stdin or as one command-line string.
Boxes will represented by the characters '1' through '9'. These characters represent their respective weights.  An empty space will be represented by a space ' '. The fulcrum will be represented by a caret '^'.

A sample input lever could look like: 8  2^ 941
This lever is perfectly balanced: (4*8) + 0 + 0 + (1*2) == 0 + (2*9) + (3*4) + (4*1) == 34

There will be no leading nor trailing spaces. There will be no trailing newline.
No need to handle malformed input, input will always have exactly one fulcrum, and only numbers and spaces.
The output will indicate whether the lever is left-heavy, right-heavy, or balanced.
Your program must have exactly 3 possible outputs that could result from a well-formed input. You can choose what these are.
The output must either be print to stdout or be the return code of the program.

Test cases
Here I use L,R,B to mean left-heavy, right-heavy, balanced:

Input: 11   ^9 Output: B

Input: 321^  12 Output: L

Input: 9^         1 Output: R

(If anyone has some "trickier" test cases, feel free to edit them in).
Bibliography
Not-necessarily-inspired-by, but related to Balance a set of weights on a seesaw

The output must either be print to stdout or be the return code of the program. Well, now you're asking me to make a distribution of Linux which uses seesaw-notation for exit codes.

I'd go play on the see-saw / teeter-totter, except most playgrounds have removed them since they are "unsafe". I hope they never remove swings for that reason. "Kids might jump off of them, oh no!"

Can input have empty sides? As in ^16, 16^ or ^? (Assume it can)

ahhh a hole in the spec, yeah I'd assume sides can be empty

I just spent several long seconds wondering how 11 offset by 3 or 4 can possibly be balanced with 9 offset 1.

Python 2, 69 bytes
lambda s:cmp(sum(ord(c)%16*(i-s.find('^'))for i,c in enumerate(s)),0)

The modulus ord(c)%16 extracts the value of a digit character while getting 0 for space. For each character, its torque contribution is computed as its weight times the signed distance to the pivot i-s.find('^'), and these are summed and compared to 0, producing one of -1,0,1. The character ^ is computed to have weight 14, but that doesn't matter because it's on the pivot.
An 18-byte Pyth port by Maltysen:
._s.e*-kxz\^%Cb16z

For the Python code, if a full program is required, here's 79 bytes. The idea is to start the index i shifted by s.find('^'), and have it count down.
s=raw_input()
t=0;i=s.find('^')
for c in s:t-=ord(c)%16*i;i-=1
print cmp(t,0)

Here is a Pyth program using your method which you can post if you want http://pyth.herokuapp.com/?code=._s.e%2a-kxz%5C%5E%25Cb16z&test_suite=1&test_suite_input=8++2%5E+941%0A11+++%5E9%0A321%5E++12%0A9%5E+++++++++1&debug=0 18 bytes. Didn't feel right about posting it myself.

@Maltysen Thanks, I included it.

Javascript ES6, 62 Bytes
s=>Math.sign([...s].reduce((p,c,i)=>p+~~c*(i-s.indexOf`^`),0))

-1 if left is heavier
0 if balanced
1 if right is heavier

Ungolfed:
s=>
  Math.sign(                     // output sign of weight of lever
    [...s].reduce((p,c,i)=>      // split and reduce input
      p+~~c*(i-s.indexOf`^`),0)) // add weights of all elements
                                 //   (elements left of pivot are negatively weighted)

Test runs (assigning anonymous function to f):
>> f("11   ^9")
<< 0

>> f("321^  12")
<< -1

>> f("9^         1")
<< 1

-11 bytes: changed output from R B L to -1 0 1
-3 bytes: changed e.split`` to [...e] (thanks @Vɪʜᴀɴ)
-33 bytes: changed algorithm to use negative weights rather than splitting at pivot
-9 bytes: removed pivot check (apparently, ~~'^' evaluates to 0...)
-2 bytes: made function anonymous (thanks @cᴏɴᴏʀ-obʀɪᴇɴ)

It is general consensus that you can omit the leading f= and say that it generates an anonymous function. (-2 bytes FYI)

APL, 39 30 bytes
{×+/(10|⍵⍳⍨∊⍕¨⍳9)×(⍳⍴⍵)-⍵⍳'^'}

After rereading the rules, I've changed this to output -1 0 1 instead of L B R, saving nine bytes.
Try it here.

Japt, 22 bytes
Japt is a shortened version of JavaScript. Interpreter
U¬r@X+~~Y*(Z-Ub'^),0 g

Returns -1 for L, 0 for B, and 1 for R.
How it works
Uq r@X+~~Y*(Z-Ub'^),0 g
                         // Implicit: U = input string
Uq r@              ,0    // Reduce the input by this function, starting at 0:
     X+~~Y*              //  Return the previous value, plus the current value times
           (Z-Ub'^)      //   the current index minus the index of "^" in U.
                      g  // Take the sign of the resulting number.
                         // Implicit: output last expression

Haskell, 116 96 82 76 bytes
 f x=signum$sum$zipWith(*)[-length(fst$span(<'^')x)..]$(`mod`16).fromEnum<$>x

Output is 0 for balanced, -1 for left-heavy and 1 for right-heavy.
Usage example: f "321^  12" -> -1
How it works: find the part before the ^. Multiply the input string and the list of weights which starts at - length-of-first-part. The ^ has a weight of 0 and doesn't add to the sum. I'm using @xnor's mod 16 trick to convert digits/spaces to integer values. If the sum is negative (positive), the lever is left-heavy (right-heavy) and balanced if the sum is 0.

TeaScript, 23 bytes 25

I tried writing a Pyth answer but that went horribly :\
$²xd»l+~~i*(a-xi`^`),0©

That ² looks so out of place but it saves 1 byte, so I'll be keeping it.
Try it online!
Test all cases
For the output scheme I've chosen:

-1 if Left is heavier than Right (L)
0 if Left is as heavy as Right (B)
1 is Left is less heavy than Right (R)

Ungolfed && Explanation
This uses maps and reduces to get the job done.
$C(xd(#l+~~i*(a-xi`^`),0))

              // Implicit: x = input
$C(           // Compare...
  xd(#        // Reduce...
    l+          // Pending weight...
    ~~i         // Current weight -> int times...
    (a-         // Total length minus...
    xi`^`       // Fulcrum location
  ,0)
)             // Implicit: Output result

Pyth, 20 bytes
._s*V-Rxz\^Uzm.xsd0z

Test suite
-1 for left-biased,
0 for balanced,
1 for right-biased.
How it works:
._s*V-Rxz\^Uzm.xsd0z
                        z = input()
                        Weights:
             m     z    Map over z
              .x        try:
                sd           cast charater to int
                  0     except: 0
                        Lever arm:
           Uz           range(len(input()))
     -Rxz\^             Subtract index of caret from each value.
   *V                   Vectorized multiplication.
  s                     Sum.
._                      Take sign and print.

pb, 349 329 bytes
^w[B!94]{>}w[B!0]{vb[T]^t[T+1]>}vb[46]<w[B!0]{<}b[1]vvb[46]^^t[X]w[X!0]{<b[T-X]}^w[B!0]{w[B=32]{b[48]}>}w[X!0]{<t[B-48]vb[B*T]^}w[B!0]{vt[B]vb[1]>^w[B!46]{>}vvb[B+T]^w[B=0]{<}b[0]^b[0]^>}vb[0]vvt[B]<w[B!0]{<}t[B+T]^>[T]w[X!0]{b[10]<}<[T]w[X!0]{b[16]>}vw[B=0]{>}t[B]b[0]w[B=0]{>}t[T-B]b[0]^<[X-T]t[B]<[X]>w[B!0]{b[0]>}<[X]^b[T+66]

This was a tricky one. pb was not designed to be good at this kind of thing. It doesn't even have multiplication. But hey, it works.

Ed. note: Did I just say pb has no multiplication? What? pb definitely definitely has multiplication. I designed and implemented this language, I should know that it has multiplication built in and I don't have to do some silly looped addition. Fixing that (as well as doing some creative rearranging now that I could approach that part of the problem from [almost literally] a different angle) saves me 20 bytes. Embarrassing.

The hardest part was, after getting the sums of (weight*distance) for each side, actually determining which letter to print. pb doesn't have > or < operators, just == and !=. There's no easy way to tell which value is larger. I can't even subtract and compare with 0... unless I do something really silly.

Find the sum of the two sums.
Go that far to the right, on a line that's not being used for anything.
Until reaching X=0, go left and place 'L's.
Place a 'B' at X=0.
Go left by the sum of the two sums.
Until reaching X=0, go right and place 'R's.

Then, you simply go to X=(left side - right side), and there's your answer! Delete everything on that line to clean up, and then print the value that was found at (0, 0).
...But there's a slightly shorter way. Instead of using 'L', 'B' and 'R', use those values - 'B' and add 'B' back on when printing. That way, you don't ever have to place 'B' at X=0, you just leave it as the 0 it already was. The only problem is that once you do this, the program becomes very goofy in watch mode. 'L'-'B'==76-66==10=='\n'. Everything seems to be working fine, until suddenly a huge number of newlines are printed and it's impossible to keep track of what's going on :D In pbi's regular execution mode, though, everything works fine because the newlines are deleted before anything is printed to the console.
^w[B!94]{>}                 # Find the fulcrum

w[B!0]{                     # Starting at the fulcrum and going right:
    vb[T]^                    # Store the T below each character of input
    t[T+1]                    # Increment T
    >
}

vb[46]                      # Put a '.' at the end of the values below the input

<w[B!0]{<}                  # Go to the space below the fulcrum
b[1]                        # Put a 1 (So the fulcrum will be represented as '.' later)
vvb[46]^^                   # Put a 46 two spaces below it

t[X]                        # Store the current X value in T
w[X!0]{<                    # Until reaching the beginning of the input:
    b[T-X]                    # Put T - (the current X value) below each byte
}

^w[B!0]{                    # For each byte of input:
    w[B=32]{b[48]}            # Set spaces to '0'
    >
}

w[X!0]{<                    # For each byte of input:
    t[B-48]                   # Set T to the value of the number (fulcrum becomes '.')
    vb[B*T]^                  # Multiply the value below by T
}

# This has nothing to do with the input, except that it's the right length:
w[B!0]{                     # For every byte of input:
    v                         # Go to the value below it
    t[B]                      # Store it in T
    vb[1]>^                   # Put a flag below it
    w[B!46]{>}                # Go to the next '.' value
    vvb[B+T]                  # Add T to whatever is two spaces below the '.'
                              # This will cause the sum for the right side of
                              # the fulcrum to be 46 too high. This is why 46
                              # was left below the fulcrum earlier: both sums
                              # will be off by the same amount.
    ^w[B=0]{<}                # Go back to the flag
    b[0]^b[0]                 # Erase the flag and the value above it
    ^>
}

vb[0]                       # Erase the stray '.'
vvt[B]<w[B!0]{<}t[B+T]      # Get the sum of the two sums
^>[T]                       # Go right that far
w[X!0]{b[10]<}              # Head back to X=0, leaving 'L'-'B' the whole way
<[T]                        # Go left the same amount as before
w[X!0]{b[16]>}              # Head back to X=0, leaving 'R'-'B' the whole way
vw[B=0]{>}                  # Find the sum from left of the fulcrum
t[B]b[0]                    # Save it to T and erase it from the canvas
w[B=0]{>}                   # Find the other sum
t[T-B]b[0]                  # Subtract it from T and erase it from the canvas
^<[X-T]                     # On the line that was just prepared, go to X=T
t[B]                        # Save the value of that space to T
<[X]>w[B!0]{b[0]>}          # Erase the entire visible part of that line
<[X]^b[T+66]                # Print (the value read from that line)+'B' at (0, 0)

Like watching the descent of a man into madness.

, 22 chars / 38 bytes
МŴ⟬ïĊ⇀$+˜_*(ã-ïÿ⍘^),0⸩

Try it here (Firefox only).

-1 this is optimizing for char count, not byte count

That's what  was built for, @Mego.

Regardless of what it was built for, the scoring is in bytes.

I understand that.

Perl 5, 72 bytes
@_=split//,<>;($i)=grep$_[$_]eq'^',0..@_;$j+=$_*($k++-$i)for@_;say$j<=>0

MATLAB 91, 57, 55 Octave, 50 bytes
I did not expect to golf this further, but switching to Octave made it possible to save 5 additional bytes! Wow, this one took time...
@(x)(s=mod(+x,16))*[1-(i=find(s>9)):nnz(x)-i]'*inf

It outputs -Inf, NaN, Inf for L, B, R respectively.
Test suite!
Explanation:
This is definitely a hard-to-read code, but I'll try to explain as well as I can. I will switch between code block explanation and text.
@(x)                 % Anonymous function that takes a string x as input
           +x        % Convert the string into a numeric array,
                     % where each character is represented by its ASCII-value
       mod(+x,16)    % Takes this string modulus 16, to make spaces (ASCII 32) equal 0
    (s=mod(+x,16))   % Assigns this numeric array to s, thanks to Octave's awesome
                     % inline variable assignment possibility
    (s=mod(+x,16))*  % Multiply s by the vector inside the brackets

Let's look at what's going on inside the brackets:
[1-(i=find(s>9)):nnz(x)-i]
      find(s>9)             % The only value in the vector s that's larger than 9,
                            % after the modulus is ^, (it's now 14)
   (i=find(s>9))            % Assign the position of `^` to the index variable i

This one is a bit tricky:
[1-(i=find(s>9)):nnz(x)-i]

The numbers on each side of the ladder must be multiplied by the distance from the caret. If we use negative numbers on the left side, and positive numbers on the right side we can simply sum the vector to see which side is heaviest.
Suppose the input string is: '321^  12'. We want the following: 3*(-3)+2*(-2)+1*(-1)+1*3+2*4. The vector we made inside the brackets starts at 1-i, which in this case is -3, since the caret is in the 4th position. It goes up to nnz(x)-i in increments of one. We can use nnz(x) instead of numel(s), because x is a string containing no zeros.
Therefore:
[1-(i=find(s>9)):nnz(x)-i]
ans =
  -3  -2  -1   0   1   2   3   4

Now, we could do element-wise multiplication s.*[...], and take the sum of this. But, since we have two vectors, we can also mutliply s by the transposed of [...] and calculate the sum using matrix multiplication:
(s=mod(+x,16))*[1-(i=find(s>9)):nnz(x)-i]'

This gives us either a negative number, meaning the left side is heavier, a zero, meaning it's balanced, or a postive numbers, meaning the right side is heavier. Instead of using the naive approach of sign(...), we multiply it by inf, which will give us either -Inf or Inf for left and right respectively. We get NaN for 0*inf, since it's undefined.
This gives us three distinct values for the three possible outcomes.

JavaScript, 146 bytes
s=>{a=[0,0];d=s.split`^`;for(j=0;j<2;j++)for(i=0;i<d[j].length;i++)a[j]+=d[j][i]*(j==0?d[j].length-i:i+1);alert(a[0]==a[1]?'B':a[0]>a[1]?'L':'R')}

Pretty massive.
Demo.

You could save quite a few bytes using ES6. The whole function t(s){ could become t=>{ and split('^') could become split\^``

@Vɪʜᴀɴ you did probably mean s=>{?

oh yes, sorry, that's what I meant

@Ypnypn -6 chars :)

PowerShell, 83 73 Bytes
param($b)$i=-$b.indexOf('^');[char[]]$b|%{$x+=$i++*"$_"};[math]::Sign($x)

Thanks to TessellatingHeckler for the golf.
Uses essentially the same algorithm as the below older code, but here we iterate through the characters in the input string one at a time rather than iterating through the index, which saves a handful of bytes. Still throws the same spectacular error message when the algorithm reaches ^ - doesn't affect STDOUT.

Previous
param($a)1..$a.length|%{$x+=+"$($a[$_-1])"*($_-$a.indexof('^')-1)};[math]::Sign($x)

Uses the same awesome algorithm as Dendrobium's excellent answer, and thus uses the same output of -1 / 0 / 1 if the input is left-heavy / balanced / right-heavy.
Ugh. Long because of a casting quirk feature that PowerShell has. Most pertinent here is how char multiplied by int functions. Taking an array-index of a string results in a char object. PowerShell converts the char to its corresponding ASCII value (rather than literal value) before multiplication. So, something like $a='012'[0];[int]$a*2 results in 96.
That means we need to re-cast it back as a string. However, simply doing string times int gives us a string repeated that many times. For example, $a='0';$a*2 would result in 00.
This means we need to cast the char back as a string before re-casting as int, then multiplication can happen, before we add it into our accumulator $x.
Couple that with the lengthy way to iterate through a string, and the .NET call to output the sign, and we get a pretty long piece of code.
NB - This will throw a spectacular error when it reaches ^ in the string, stating that it can't convert it to an int. Doesn't affect STDOUT.

I have param($b)$i=-$b.indexOf('^');[char[]]$b|%{$x+=$i++*+"$_"};[math]::Sign($x) at 74 bytes. This took a long while and several approach attempts. math::sign looks so long, but I can't see any way to improve that bit.

@TessellatingHeckler Sure, iterating through the characters themselves rather than the indices ... makes sense! I golfed an additional byte by using PowerShell's implicit casting $i++*+"$_" is equivalent to $i++*"$_" if $i is an int.

Ruby, 111 108 bytes
->s{l,r=s.split'^';v=->x{x.chars.map.with_index{|c,i|c.to_i*(i+1)}.reduce:+};%w(B L R)[v[l.reverse]<=>v[r]]}

Explanation
Sums up weighted value of each number on each side. Then it uses the ruby spaceship operator to provide a 1,0,-1 of equality/inequality of the two sides, which is the index of an array with the correct output.

Python 3, 196 114 bytes
r=0
I=list(input())
p=I.index("^")
i=0
for E in I:
 if E.isdigit():r+=int(E)*(p-i)
 i+=1
print('BLR'[(r>0)-(r<0)])

Regular code:
total = 0

inp=list(input())
ful_index=inp.index("^")

i=0
for num in inp:
    if num.isdigit(): total += int(num) * (ful_index - i)
    i+=1

print('BLR'[(total>0)-(total<0)])

Explanation:

Generates a list of numbers + the fulcrum from stdin.
For every number, adds the distance from the fulcrum times the number to the variable to the total (numbers on the left will be negative and numbers on the right will be positive).
Prints the correct letter depending on the result (B if equal, L if more than zero, and R if less than zero).

Huge thanks to @ThomasKwa for trimming 82 bytes (more than 40%) off!

An easy 15 or so bytes: Use print('LBR'[(B>D)-(B<D)]) for the end, and B=D=0 at the start.

No, even better: don't keep track of the left and right separately; instead multiply by a negative distance for numbers left of the ^. That saves you the abs() too.

C, 140 139 138 134 100 bytes
Return:

1 = LEFT
2 = BALANCED
0 = RIGHT

k;main(int x,char**a){char*n=a[1],*g=n;for(;*n^94;++n);for(;*g;++g)k+=(*g&15)*(n-g);return!k?2:k>0;}

Run:
./see-saw "11   ^9"
echo $?
2

As we have ASCII:
SPACE = 0x20
    0 = 0x30 ... 9 = 0x39

We get:
0x20 & 0x0f = 0
0x30 & 0x0f = 0
0x31 & 0x0f = 1
0x32 & 0x0f = 2
... etc.

Then sum by factor distance to ^.

CJam, 29 bytes
l_'^#\"^ "'0er'0f-_,,@fm.*:+g

Try it online
Result is -1 for left-heavy, 0 for balanced, 1 for right-heavy.
This seemed a bit lengthy, but I tried a bunch of alternatives, and they all ended up between 29 and 33 bytes. One problem is that I couldn't find a way of converting the string to values that would automatically result in 0 for the spaces. So I ended up explicitly replacing the spaces with '0 characters, which obviously adds to the length of the code.
Alternatives tried:

Splitting string at '^, reversing the 1st one, and then calculating the weighted value for both.
Using the ee operator to add the index to the list of values.
Instead of subtracting the caret position from each index, calculate the dot product without the subtraction, and then subtract caret position times string length from the result.

Explanation:
l         Get input.
_'^#      Copy and find caret position.
\         Swap input back to top.
"^ "'0er  Replace caret and spaces with '0.
'0f-      Subtract '0 from all characters, to get integer values.
_,,       Build index array with same length.
@         Rotate caret position to top.
fm        Subtract it from all indices.
.*        Calculate element wise product of two vectors.
:+        Add up the element products to get dot product.
g         Signum.

SpecBAS - 140 bytes
1 INPUT b$: LET t=0,p=POS("^",b$),l$="RBL"
2 FOR i=1 TO LEN b$
3 IF b$(i) IN ["1" TO "9"] THEN INC t,(p-i)*VAL b$(i)
4 NEXT i
5 TEXT l$(2+SGN t)

t is a running total, the values are negative when character position is more than the carat position. At the end it sees if total is negative, zero or positive and prints the corresponding character of R, B or L.
I could shave a few bytes off by just outputting -1, 0 or 1 like some of the other answers.

Java, 83 bytes
l->{int s=0,l=0;for(char c:l)if(l<1)s-=c-48;else s+=c-48;return s<0?-1:(s>0?1:0));}


text:
Quine Pride Parade!
These days, I watched on TV a Gay Pride parade; at the time, I was thinking about quines and how they're a bit queer, outputting themselves (out of the  closet?) and, well, why not combine both things into a Quine Pride Parade?
The challenge is to write a program that:

Is a quine.
Prints the sentence I am a quine written in <language name>, and very proud of it! with the name of the language you're using in place of language name.
Contains the sentence within a rectangular frame of non-whitespace characters, with at least one row/column of spaces above, below, before and after it.
Contains the sentence in three rows, with centered text, like in my entry below. You can add at most one space before the language name, to align the second line within the frame.

The program itself does not need to have a rectangular form, but must frame the sentence.
Scoring
As Dennis pointed out, languages with shorter names have an advantage, and most bytes will go into the frame.
So, the scoring will be as follows: size of the program (in bytes), minus the size of the language's name, minus 140 (a tweet's size). The following bonuses are applied after that:

-50% if the program also accepts a custom sentence, outputs it on the generated program's frame instead of the default message, and the generated program is still a quine. Assume a tweet-sized sentence (140 chars max). Without input, it can output, either the default sentence above, or an empty frame.
-30% if the program shows only one copy of the sentence (the other should be obfuscated).

The bonuses stack: getting both does (n - 50%) - 30% = 0.5n - 30% = 0.35n.
The smallest score wins.
Here is my entry, in Ruby - should have a linebreak at the end. No bonus, score 399 = 543 bytes - 4 - 140.
q=34.chr;e=10.chr;prideful=''+
'                         '+e+
'      I am a quine       '+e+
'    written in  Ruby,    '+e+
'  and very proud of it!  '+e+
'                         '+e;s=[
"q=34.chr;e=10.chr;prideful=''+",
"'                         '+e+",
"'      I am a quine       '+e+",
"'    written in  Ruby,    '+e+",
"'  and very proud of it!  '+e+",
"'                         '+e;s=[",
"@",
"];t=s.map{|x|q+x+q}.join(','+e)",
"s.each{|y|puts(y!='@'?y:t)}"
];t=s.map{|x|q+x+q}.join(','+e)
s.each{|y|puts(y!='@'?y:t)}

It is a classic quine format: s contains itself, as an array (one element per line), except for itself's quote (the @); then, joins s, substituting @ by the join, quoted.
The program can clearly be golfed further: I went for a nice rectangular format instead.

The idea of quines being queer and being "in the closet" is making me laugh so much that I have to attempt this.

Can I have bonus points if I use terminal colour codes to make it coloured like a rainbow flah?

For the -50% bonus. Can we assume input will always be provided?

For many languages, most parts of the program will consist of padding to achieve the frame. For all of these languages, the decisive factor will be which one has the shortest name.

Now that this has been reopened, is a cheating quine okay? My language can't make a real quine.

Aubergine, 7*24+1-9=160-140=20-30%=14 bytes
-a1+a1=oA=Bi-BA:bB=iaooo
o                      o
o I am a quine written o
o  in Aubergine, and   o
o  very proud of it!   o
o                      o
oooooooooooooooooooooooo    (removethis)

The (removethis) is not code, but is just there to protect the trailing whitespace.
It's just my standard aubergine quine with all the extra stuff stuck in it to meet requirements.

On the spot! Will you try for the other bonus?

No. Doing so would massively increase my score as writing a custom message in the required positions, with line breaks in sane places requires an enormous amount of flow control, which is difficult in this language. This is the best score this language can get. (A language with a shorter name will be able to do a lot better.)

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Quiz Program Compiler
A fun programming exercise is to write a program that quizzes the user from a set list of questions and answers. However, this task goes a level beyond that.
Your task

Write a program/func/etc. that takes two lists: A list of questions and a list of answers.
Output a program that quizzes the user.
The output program should ask each question on a separate line, which each question with a colon and space at the end like, What is 2+2:.
After the user answers all the questions, output a newline, and then one on each line, questions correct, questions wrong, and percentage calculation (rounded to 2 decimal places) as such (the brackets are user input):

What is the meaning of life, the universe, and everything: <42>
Am I awesome(Yes/No): <No>
What is 2+2: <4>

Number Correct: 2
Number Wrong: 1
Score: 2 / 3 * 100 = 66.67%

Scoring

You are scored on the size of your compiler program.
This is code-golf so shortes code in bytes wins!
Bonus: Score *.9 if you implement a flag in your compiler that makes the output program randomize question order.

If none are correct, or all are wrong, should that line be skipped?

@Ypnypn no, they should always be there.

Can I use JS's prompt and alert for I/O? (As in, prompt each question with the text <question>: , then alert each line of the result separately)

CJam, 105 99 bytes
{{": "+ol}%.=_:+\,:LX$-X$LX$e2Ld/]"
Number Correct: %d
Number Wrong: %d
Score: %d / %d * 100 = %.2f%%"e%}

This defines an anonymous function.
The code is 110 bytes long and qualifies for the × 0.9 randomization bonus.
Test run
$ cat qna.cjam
[
  [
    "42"
    "Yes"
    "4"
  ]

  [
    "What is the meaning of life, the universe, and everything"
    "Am I awesome(Yes/No)"
    "What is 2+2"
  ]
]

{zmrz~{": "+ol}%.=_:+\,:LX$-X$LX$e2Ld/]"
Number Correct: %d
Number Wrong: %d
Score: %d / %d * 100 = %.2f%%"e%}

~

$ cjam qna.cjam
What is 2+2: 4
Am I awesome(Yes/No): No
What is the meaning of life, the universe, and everything: 42

Number Correct: 2
Number Wrong: 1
Score: 2 / 3 * 100 = 66.67%

Wow, this is the longest CJam answer I have ever seen!

Not even close. :)

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Make a Math Competition Grader
I enjoy participating in math competitions run by Mu Alpha Theta, a mathematics honor society in the United States. At competitions, I take a 30-question multiple choice test. There are five choices per question, labeled A through E.
My score on a test is four points for each correct answer, zero points for a question left blank, and negative one points for each wrong answer.
Write a program that grades a test according to the above scoring system. There should be two components to the input: an answer key followed by responses. Questions left blank are to be inputted as blank spaces. The first input must contain only the letters A-E (or a-e, your choice), and it can be assumed that there is no whitespace in the input. The second input must only contain blank spaces and the letters A-E (or a-e). Inputs not implementing 30-question tests must print Invalid test as output.
The output should be the grade or Invalid test.
Bonus
If your program prints the number right, number left blank, and number wrong after the final score as (aR bB cW), take off 20 bytes.
Sample input
CABBDCABECDBACDBEAACADDBBBEDDA    //answer key
CABEDDABDC BACDBBAADE  CBBEDDA    //responses

Sample output
No bonus
73

Bonus
73 (20R 3B 7W)

Standard rules apply. Shortest code in bytes wins.

What should we do with spaces in the first line?

@ThomasKwa There shouldn't be spaces in the first line. Invalid test.

It appears you changed the rules after answers were posted, which invalidated at least 2 of them. Please do no make changes which could invalidate answers after a challenge is posted. It's a good idea to use the Sandbox to get feedback prior to posting.

I think this would have been more interesting as [tag:underhanded]

how about case sensitivity? also, what if my language is... unpleased by whitespace? can i specify whitespace in the input should be underscores instead?

@sysreq There shouldn't be any whitespace in the input to begin with. Tests don't have blank spaces in their answer keys.

does the input have to only have abcde, or can it accept any char?

I was quite sure that the check of the range for input (A...E or space and no more) was requested, but doubt it now. Changing the rules is always a mess

Pyth, 53 51
?&!-sJ.z+d<G5&FqR30lMJ+sm?qFd4_1CJ/eJd"Invalid test

Try it online
The checks are done by seeing if the entire input contains any characters when all of the spaces and a-e are removed, and by checking if both strings have length 30.
The score calculation is done by zipping the two lines together, then by mapping each pair to: (letters are equal) ? 4 : -1. Then simply summing the values, and adding the number of spaces in the second line back to the score.

No errors. (Currently fewer bytes than Dennis's answer...)

Seriously, 86 bytes
,`;l5╙¬=);' UΣS" ABCDE"=(**;l`Mi@)=YWé"Invalid test"0WX@Z```i@;(=5*(' =D+`(;l@)5╙¬=IMΣ

Takes input like "CABBDCABECDBACDBEAACADDBBBEDDA", "CABEDDABDC BACDBBAADE  CBBEDDA"
Try it online (you will have to manually enter the input because permalinks don't like quotes)
Working on the bonus now. Nope, adding the bonus would cost more than 20 bytes.
I knew I was forgetting something... Invalid Test wasn't being printed in the event of an error. There go my hopes of out-golfing Dennis.

Does it? Seriously? Then I have to upvote it

JavaScript (ES6), 134 bytes
Edit: The question requirements changed. This answer is from when the program needed to make sure each answer character is A-E, each response character is A-E or space and they both have lengths of 30, else return Invalid test.
(a,r)=>[...a].map((q,i)=>q>"E"|q<"A"?x=1:(c=r[l=i])==" "?0:c>"E"|c<"A"?x=1:c==q?s+=4:s--,s=x=0)&&x|l!=29|r.length!=30?"Invalid test":s

Explanation
(a,r)=>                   // a = answer string, r = responses string
  [...a].map((q,i)=>      // iterate over answers, q = answer, i = question number
    q>"E"|q<"A"?x=1:      // x = 1 if answer is invalid
    (c=r[l=i])==" "?0:    // c = question response, l = answer length, add 0 for space
    c>"E"|c<"A"?x=1:      // x = 1 if response is invalid
    c==q?s+=4:s--,        // add 4 if correct, subtract 1 if incorrect
    s=x=0                 // s = total score, x = is invalid
  )&&
    x|l!=29|r.length!=30? // check input lengths for validity
      "Invalid test":
      s                   // return the score

Test

<input type="text" id="answers" value="CABBDCABECDBACDBEAACADDBBBEDDA" />

<input type="text" id="responses" value="CABEDDABDC BACDBBAADE  CBBEDDA" />

<button onclick='result.innerHTML=(

(a,r)=>[...a].map((q,i)=>q>"E"|q<"A"?x=1:(c=r[l=i])==" "?0:c>"E"|c<"A"?x=1:c==q?s+=4:s--,s=x=0)&&x|l!=29|r.length!=30?"Invalid test":s

)(answers.value,responses.value)'>Go</button>

CJam, 60 bytes
2{l_,30=\N?}*_2$|S'F,65>+-!@2$.{=4W?}@' f=+:+"Invalid test"?

Try it online in the CJam interpreter.

JavaScript (Firefox 31+), 86 bytes
(x,y)=>(r=i=0,[for(l of y)x[i++]==l?r+=4:r-=l!=' '],i!=30|i-x.length?'Invalid test':r)

Uses array comprehension which is proposed for ES7. Thus support is limited to Firefox for the moment.
With bonus, 106 bytes (126 - 20)
(x,y)=>[r=w=i=0,[for(l of y)x[i++]==l?r++:w+=l!=' '],`${r*4-w} (${r}R ${i-r-w}B ${w}W)`,'Invalid test'][i!=30||i-x.length?3:2]

Edit: Previously my solution only checked answer or question length, now checks both.

F=(x,y)=>(r=i=0,[for(l of y)x[i++]==l?r+=4:r-=l!=' '],i!=30|i-x.length?'Invalid test':r)
G=(x,y)=>[r=w=i=0,[for(l of y)x[i++]==l?r++:w+=l!=' '],`${r*4-w} (${r}R ${i-r-w}B ${w}W)`,'Invalid test'][i!=30||i-x.length?3:2]

var score = () => result.innerHTML = (bonus.checked ? G:F)(questions.value, answers.value);

questions.oninput = answers.oninput = bonus.onchange = score;
score();
* {
    box-sizing: border-box;
}

label {
  float: left;
  clear: left;
  vertical-align: middle;
  line-height: 2;
  padding-right: 0.5em;
}

input[type="text"] {
  width: 100%;
  vertical-align: middle;
  line-height: 2;
  font-family: monospace;
  padding: 0 0.5em;
}

input[type="checkbox"] {
  vertical-align: middle;
  line-height: 2;
  margin: 0.5em;
}

hr {
  clear: both;
}

.input-wrapper {
  overflow: hidden;
  width: auto;
}

#result, #error {
  font-weight: bold;
}

#error {
  display: none;
}

Q:

  <input id="questions" type="text" value="CABBDCABECDBACDBEAACADDBBBEDDA"/>

A:

  <input id="answers" type="text" value="CABEDDABDC BACDBBAADE  CBBEDDA"/>

Bonus:

  <input id="bonus" type="checkbox" checked/>

  Result:

  ERROR: Unsupported browser! Try Firefox 31+

You can omit the f= at the beginning and say that this generates a lambda function.

@CᴏɴᴏʀO'Bʀɪᴇɴ Thanks I always forget it's on their from testing -_-

This would be significantly shorter without the bonus. 86 bytes: (x,y)=>(r=i=0,[for(l of y)x[i++]==l?r+=4:r-=l!=' '],i!=30|i-x.length?'Invalid test':r)

@user81655 True, thanks... I got a little caught up in it... the template string alone is 34 bytes

I have a very similar answer, but I did not copied this one (my first attempt is precedent, but I deleted it as I was not checking the lengths). That said: this is not valid notwithstanding 3 upvotes,as does not check the range A...E

@edc65 That was edited out of the question before this was answered. See the note on the other JavaScript answer which states it was before the requirements change.

No. Question as it is now: The second input must only contain blank spaces and the letters A-E (or a-e). Inputs not implementing 30-question tests must print Invalid test as output. The check for blank spaces in the first input was edited out

Just see the other answers...

@edc65 Just look at the edit history, this was removed... Inputs containing other characters or inputs not implementing 30-question tests must print Invalid test as output. Stating what the input is doesn't mean it needs to be validated.

@edc65 Also your current answer doesn't pre-date this one. And none of your previous edits look similar to it.

Let us continue this discussion in chat.

C#, 162 154 148 134 bytes
string g(string k,string a)=>k.Length!=30||a.Length!=30?"Invalid Test!":Enumerable.Range(0,30).Sum(e=>a[e]==' '?0:k[e]==a[e]?4:-1)+"";

Usage
g("CABBDCABECDBACDBEAACADDBBBEDDA", "CABEDDABDC BACDBBAADE  CBBEDDA")

Test
http://csharppad.com/gist/15f7c9c3c8cfce471ff2

You could change it to int s=0,i=0;for(;... to save 3 bytes.

This wont work if I input 29 chars for first input and 31 for second.. it should print "invalid test" but will actually try to grade.

@noisyass2: string x(string k,string a)=>k.Length!=30||a.Length!=30?"Invalid Test!":Enumerable.Range(0,30).Sum(e=>a[e]==' '?0:k[e]==a[e]?4:-1)+""; (134 chars) and considers Johans input.

+1 for solution, but does this qualify? OP said full program.

Johan nice catch!
@StephanSchinkel thanks for the idea on using the delegate and the Enum.range bit. I was able to shave of 3 more chars changing the condition to 30==(k.Length&a.Length)

nevermind, realized bitwise and of 30 and 31 is 30 so it wouldnt work. Went with Stephan's input

This just checks the input len, but does not print "Invalid Test" if there are characters out of range A...E. I think it should

Haskell, 144 138 bytes
a%b|map length[a,b]==[30,30]&&"ABCDE"!a&&"ABCDE "!b=show$sum$zipWith(?)a b|0<1="Invalid test"
l!s=all(`elem`l)
_?' '=0
x?y|x==y=4|0<1=0-1

Would be about 50 without the validation. sniff.
Usage: "ABCDEABCDEABCDEABCDEABCDEABCDE" % "AAAAABBBBBCCCCCDDDDDEEEEEAAAAA"

! can be defined as all(`elem`l)s, saving 6 bytes.

... or go pointfree: g=all.flip elem.

Japt, 71 bytes
Japt is a shortened version of JavaScript. Interpreter
Ul ¥30©Vl ¥30«(U+V k"[A-E ]+" ?U¬r@VgZ ¥Y?X+4:VgZ ¥S?X:X-1,0 :`InvÃ. È.

The two .s at the end should be the unprintable Unicode chars U+0017 and U+0099, respectively.
How it works
Ul ==30&&Vl ==30&&!(U+V k"[A-E ]+" ?Uq r@VgZ ==Y?X+4:VgZ ==S?X:X-1,0 :"Invalid test
                    // Implicit: U = first input, V = second input
Ul ==30&&Vl ==30&&  // If both input lengths are 30, and
!(U+V k"[A-E ]+"?   // removing all ABCDE and spaces from (U+V) results in an empty string:
Uq r@            ,0 //  Reduce U with this function, starting with a value of 0:
VgZ ==Y?            //   If the matching char in V is equal to this char,
X+4                 //    return previous value + 4.
:VgZ ==S?X          //   Else if the matching char in V is a space, return previous value.
:X-1                //   Else (if it's wrong), return previous value - 1.
:"Invalid test      // Else, return "Invalid test".
                    // Implicit: output last expression

I hope there's a shorter way to make sure both lengths are equal to 30. Suggestions welcome!

Python 2.7, 131, 116, 109, 139
I tried to do a "short" python solution... Well here it is, suggestions are more than welcome
lambda c,d:d.count(' ')+sum([-1,4][a==b]for a,b in zip(c,d)if b!=' ')if not set('ABCDE ')^set(c+d)and len(c)==len(d)==30 else'Test Invalid'

Adding a few more characters makes it far more readable...
def m(c, d):
    if len(c)==len(d)==30:return d.count(' ')+sum((a==b)*4+(a!=b)*-1 for a,b in zip(c,d)if b!=' ')
    return'Test Invalid'

Java, 183 169 bytes
This was a nice bit of Java 8 practice:
String f(String a,String r){return a.length()==30&r.length()==30?""+IntStream.range(0,30).map(i->a.charAt(i)==r.charAt(i)?4:r.charAt(i)!=' '?-1:0).sum():"Invalid test";}

I'm not a Java Golfer, but I think you can save the String.valueOf by just adding the int to an empty string (""+IntStream....) - I also believe Java allows non-short-circuiting and, so you can remove one of the & and save a byte.

@VisualMelon Great tips, thanks. It was annoying me how many bytes String.valueOf took up!

Ruby, 81 characters
->t,s{r=0;30.times{|i|r+=t[i]==s[i]?4:s[i]>' '?-1:0};t.size==30?r:'Invalid test'}

Sample run:
2.1.5 :001 > ->t,s{r=0;30.times{|i|r+=t[i]==s[i]?4:s[i]>' '?-1:0};t.size==30?r:'Invalid test'}['CABBDCABECDBACDBEAACADDBBBEDDA','CABEDDABDC BACDBBAADE  CBBEDDA']
 => 73

2.1.5 :002 > ->t,s{r=0;30.times{|i|r+=t[i]==s[i]?4:s[i]>' '?-1:0};t.size==30?r:'Invalid test'}['CCCATCH','CABEDDABDC BACDBBAADE  CBBEDDA']
 => "Invalid test"

brainfuck, 354 bytes
+[--[>]<<+>-],----------[[<<<]>>->[>>>],----------]<<<[<<<]>>+[<-[-------<+>]<.+[---<+>]<.++++++++.[-<+++>]<-.+++++++++++.---.-----.-[---<+>]<-.---[-<++++>]<.+++[-<+++>]<.[---<+>]<----.+.>]>[[>,----------->+++++++[<---<<+++>>>-]<[<<+[>>+<<-]]>[>]<<<[>[>+>+<<-]>>[<<+>>-]>[>>>]>----<<<<[<<<]>>[-]]>[>-<-]>[>>[>>>]>-----<<<<[<<<]>[-]]>>]----[>+++<--]>--.<]

Requires an interpreter that allows you to go left from cell 0. Output is a signed byte. For example, the byte 0x49 is printed for the example input, and 0xFF is printed for input with the same first line but the second line replaced with "C" and 29 spaces.
The score starts at 0, and as the second line of input is read these changes are made to it:

Input is correct: Do nothing
Input is incorrect: Subtract 5
Input is a space: Subtract 4

Finally, 120 is added. This is functionally the same as assuming a perfect score and applying penalties, rather than starting at 0.
With comments:
+[--[>]<<+>-]                          Get 29

,----------[[<<<]>>->[>>>],----------] Get first line of input; for each char sub one
                                       from the 29

<<<[<<<]>>+                            Add one to the cell that originally held 29

[                                      If the cell that originally held 29 is nonzero:

  Write "Invalid test"
  <-[-------<+>]<.+[---<+>]<.++++++++.[-<+++>]<-.+++++++++++.---.-----.-[---<+>]<-.---[-<++++>]<.+++[-<+++>]<.[---<+>]<----.+.

>]

>[                                     If the cell to the right is nonzero:

  This block is only ever entered if "Invalid test" isn't written!

  [                                      For all 30 characters of the first input:

    >,                                     Get char from second input to the right

    ----------                             Subtract 10 for consistency

    -                                      Subtract one more

    >+++++++[<---<<+++>>>-]                Subtract 21 (plus above lines = 32)

    <[                                     If it's nonzero:

      <<+[>>+<<-]                            Add 22 to the character

    ]

    >[>]<<<[                                 If the above block wasn't entered:

      >[>+>+<<-]>>[<<+>>-]                   Make a copy of the character from input 1

      >[>>>]>----                            Subtract 4 from the score

      <<<<[<<<]>>[-]                         Go to the cell just before first character

    ]

    >[>-<-]                                Subtract input 1 char from input 2 char

    >[                                     If the result is nonzero:

      >>[>>>]>-----                          Subtract 5 from the score

      <<<<[<<<]>[-]                          Go back to the result and set it to 0

    ]

    >>                                     Move on to next character

  ]

  ----[>+++<--]>--                       Add 120 to score (perfect score)

  .                                      Print score

  <                                      Go to an empty cell to kill loop

]

Python 3, 187 179 175 165 155 151
lambda a,b:(['Invalid test',sum([-1,4][i==j]for i,j in zip(a,b))+b.count(' ')][len(a)==len(b)==30and set(a)^set('ABCDE')==set(b)^set('ABCDE ')==set()])

JavaScript ES7, 102
As usual, the bonus is not worth the effort.
(k,h,t=i=0)=>[for(x of h)t+=k[i++]==x?4:1-x?0:-1]|/[^ A-E]/.test(k+h)|i-30|k.length-i?"Invalid test":t

Checking for invalid spaces in first input (as this makes sense to me) 112
(k,h,t=i=0)=>[for(x of h)(y=k[i++])>' '?t+=y==x?4:1-x?0:-1:k=h+h]|/[^ A-E]/.test(k+h)|i-30|k[i]?"Invalid test":t

Ugh, the validation took up half of my code when I tried: (k,r,s=0)=>/^[A-E]{30}$/.test(k)&&/^[ A-E]{30}$/.test(r)?Object.keys(k).map(i=>k[i]==r[i]?s+=4:s-=r[i]!=' ').pop():'Invalid Test' is 129 bytes.

C# 6.0 --> (270 - 20 = 250) 246 - 20 = 226 bytes
void m(string b,string c){if((b+c).Length==60){var a=new int[3];int s=0;for(int i=0;i<30;i++){if(b[i]==c[i]){a[0]++;s+=4;}else if(c[i]==' ')a[2]++;else{a[1]++;s--;}}Console.Write(s+$" ({a[0]} {a[2]} {a[1]})");}else Console.Write("Invalid test");}

Readable & ungolfed version:
    void m(string b, string c)
    {
        if ((b+c).Length==60)
        {
            var a = new int[3];
            int s = 0;
            for (int i = 0; i < 30; i++)
            {
                if (b[i]==c[i])
                {
                    a[0]++;
                    s+=4;
                }
                else if (c[i] == ' ')a[2]++;
                else
                {
                    a[1]++;
                    s--;
                }
            }
            Console.Write(s+$" ({a[0]} {a[2]} {a[1]})");
        }
        else Console.Write("Invalid test");
    }

Really wanted to get the bonus :D

Nice work! A few of general tricks that apply here, you can declare i along with s outside the for loop. You can use var to declare a, saving 1 byte (hurrah!). You don't need many of the curly braces {} in your code, which is always a good way to trim bytes, and it's always worth looking at an ASCII table when comparing chars (you can knock a byte off c[i]==' ' somewhat by using an inequality). You should also consider counting through the strings backwards - in this case you can save at least 1 byte by rejigging the for loop somewhat.

Unfortunately, your submission is currently not complicit with the criteria, as it is unable to recognise invalid inputs.

@VisualMelon Ahh, I feel so dumb. I wrote this submission at school so I forgot to add the 'invalid test' things etc. I'll add them :)

@VisualMelon Yeah, this was submitted and written in school at the end of the class, I'll edit it. Thanks for the tricks :)

Prolog, 165 bytes
More than half the bytes are for the invalid tests check.

Code:
p(X,X,4).
p(_,32,0).
p(_,_,-1).
A*B:-length(A,30),length(B,30),subset(A,`ABCDE`),subset(B,`ABCDE `),maplist(p,A,B,L),sum_list(L,S),write(S);write('Invalid Test').

Explained:
p(X,X,4).                                       % If corresponding elements are equal, 4p
p(_,32,0).                                      % If answer is 'space', 0p
p(_,_,-1).                                      % Else, -1p
A*B:-length(A,30),length(B,30),                 % Check that input is of correct length
     subset(A,`ABCDE`),subset(B,`ABCDE `),      % Check that input has correct characters
     maplist(p,A,B,L),sum_list(L,S),write(S);   % Create a list of scores (L) and print sum
     write('Invalid Test').                     % If anything failed, write Invalid Test

Example:
`CABBDCABECDBACDBEAACADDBBBEDDA`*`CABEDDABDC BACDBBAADE  CBBEDDA`.
73

Try it out online here

MATLAB, 92 90 bytes
Thanks to Tom Carpenter for helping me to reduce my answer by 2 bytes!
function c(q,a),if nnz(q)~=30,t='Invalid test';else s=q-a;t=5*nnz(~s)-sum(s<9);end,disp(t)

Function can be called by assigning the answer sheet to q and the submitted answers to a. e.g.:
c('CABBDCABECDBACDBEAACADDBBBEDDA','CABEDDABDC BACDBBAADE  CBBEDDA')

The answer is simply printed to the screen. 8 bytes could be saved if it is allowed to print ans = 73

You could save 2 bytes by replacing numel(q) with nnz(q).

Groovy 2.4.5, 107 bytes
Just a simple translation of the earlier Java answer.
f={a,b->a.length()==30&b.length()==30?(0..29).collect{a[it]==b[it]?4:b[it]!=' '?-1:0}.sum():'Invalid test'}

C, 273 - 20 = 253 bytes
#include<stdio.h>
#include<string.h>
int main(int c,char**v){char*p=v[1],*q=v[2],*s=" ABCDE",r[]={0,0,0};if(strspn(p,s+1)!=30||p[30]||strspn(q,s)!=30||q[30])puts("Invalid test");else{for(;*p;++q)++r[(*p++!=*q)+(*q==' ')];printf("%d (%dR %dB %dW)",4**r-r[1],*r,r[2],r[1]);}}

I've taken the bonus, even though it cost me 23 bytes just to print it.  :-(
Explanation
#include <stdio.h>
#include <string.h>
int main(int c,char**v)
{
    char *p=v[1], *q=v[2],      /* arguments */
        *s=" ABCDE",            /* valid chars */
        r[]={0,0,0};            /* results - right, wrong, blank */

    if (strspn(p,s+1) != 30     /* validity check - answer key begins with [A-E]{30} */
        || p[30]                /* and ends there */
        || strspn(q,s) != 30    /* same for answers, but allow space, too */
        || q[30])
    {
        puts("Invalid test");
    } else {
        for ( ;  *p;  ++q)      /* for each answer */
            ++r[(*p++!=*q)+(*q==' ')]; /* increment the appropriate counter */
        printf("%d (%dR %dB %dW)",4**r-r[1],*r,r[2],r[1]); /* print result */
    }
}

There's twice as much code to check for invalid input as there is to count the answers - the real meat of the challenge is in the for loop near the end.  In fact here's a version that assumes the input is always valid, in 163-20 = 143 bytes:
#include<stdio.h>
int main(int c,char**v){char*p=v[1],*q=v[2],r[]={0,0,0};for(;*p;++q)++r[(*p++!=*q)+(*q==' ')];printf("%d (%dR %dB %dW)",4**r-r[1],*r,r[2],r[1]);}

And one that makes the same assumption and prints only the score, in 133 bytes:
#include<stdio.h>
int main(int c,char**v){char*p=v[1],*q=v[2],r[]={4,-1,0};for(c=0;*p;++q)c+=r[(*p++!=*q)+(*q==' ')];printf("%d",c);}

SAS 9.4, 291-20 = 271 bytes(with bonus), or 231 bytes(without bonus)
With bonus:
data a;k='CABBDCABECDBACDBEAACADDBBBEDDA';r='CABEDDABDC BACDBBAADE  CBBEDDA';c=0;b=0;w=0;if length(k) ne 30 then put "Invalid test";do i=1 to 30;if substr(k,i,1)=substr(r,i,1) then c=c+1;else if substr(r,i,1) =' ' then b=b+1;else w=w+1;end;a=cat(c*4-w,' (',c,'R ',b,'B ',w,'W)');put a;run;

Without bonus:
data a;k='CABBDCABECDBACDBEAACADDBBBEDDA';r='CABEDDABDC BACDBBAADE  CBBEDDA';c=0;if length(k) ne 30 then put "Invalid test";do i=1 to 30;if substr(k,i,1)=substr(r,i,1) then c=c+4;else if substr(r,i,1)ne' ' then c=c-1;end;put c;run;

Sas does not really have an input/output, so you would need to replace the k='..' with the key, and r='..' with the response.  The output is printed to the log.


text:
List numbers within given ranges
Goal:
Your goal is to print out numbers within a given range (Also including given values).
Input Format:
The input will look like:
(int-int, int-int, ...)
... meaning the user can add as many int-int as they'd like.
Other Info:

You will only have to handle non-negative integer numbers.
The first integer in int-int will always be smaller, or the same, then the next integer in int-int
The input will always have at least two int-int
Each int-int will followed by a comma and a space, except for the last one.
This is code-golf meaning the shortest answer wins!

Examples / Test Cases:

Example 1:
Input:
(10-13, 11-15, 0-3)
Output:
10 11 12 13 11 12 13 14 15 0 1 2 3
Example 2:
Input:
(1-5, 1-15)
Output:
1 2 3 4 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Example 3:
Input:
(1-2, 1-3, 1-3, 1-2)
Output:
1 2 1 2 3 1 2 3 1 2
Example 4:
Input:
(4-6, 0-1, 9-9)
Output:
4 5 6 0 1 9

Will the input have all the ( and the ,  or can we take an array of n-n for the input?

@Downgoat It will have all the other (, , , ) too.

Will the first integer always be less than the second or can it be reversed and still be valid? e.g. 11-10 would give 11 10
I'd recommend adding a test case for that and for when the integers are the same (e.g. 10-10 -- though I'd imagine this would give 10)

@Cole Great question(s), yes the first integer will always be smaller and in the case of the numbers being the same it should just print that number (8-8 => 8).

Unfortunate that this was closed. It isn't a complete duplicate, as the other one requires comma-separated output. I have a cute answer (valid?) in ngn/apl: Instead of a program/function to do the work, I redefine minus to give the desired output: -←{(⊃~⍨/⍳¨⍺,1+↑⍵),1↓⍵}. Now (10-13, 11-15, 0-3) evaluates to 10 11 12 13 11 12 13 14 15 0 1 2 3!

CJam, 19
qS/{'.,Ser~),>~}%S*

Martin Büttner killed 2 bytes again, thanks :)
Try it online
Explanation:
q       read input
S/      split by space
{…}%    transform each string (containing a pair of numbers and some other chars)
  '.,   enumerate all characters smaller than '.'
  Ser   replace them all with a space in the string
  ~     evaluate the resulting string, pushing the 2 numbers on the stack
         let's call them A and B
  ),    create an array [0 1 … B]
  >     slice it from A: [A … B]
  ~     dump it onto the stack
S*      join the resulting array with spaces

Minkolang 0.13, 12 bytes
nd1+?.n~Lr$N

Try it here.
Explanation
n      Take number from input (-1 if input is devoid of numbers)
d1+    Duplicate and add 1
?.     If this is 0, stop.
n~     Get number from input and negate it (because of the '-')
L      Pops b,a and pushes a,a+1,a+2,...,b-1,b
r      Reverses list
$N     Outputs whole stack as numbers

Julia, 75 bytes
s->print((j=join)(map(i->j(i," "),eval(parse(replace(s,"-",":"))))," "))

This is an anonymous function that accepts a string and prints to STDOUT. To call it, give it a name, e.g. f=s->....
Ungolfed:
function f(s::AbstractString)
    # Replace dashes with colons in the input
    c = replace(s, "-", ":")

    # Parse as a tuple of UnitRange objects
    r = eval(parse(c))

    # Join each range with spaces
    m = map(i -> join(i, " "), r)

    # Join into one string and print
    print(join(m, " "))
end

Javascript (ES 2015), 86 83 bytes
f=r=>{z="";r.replace(/(?:(\d+).(\d+))/g,(m,n,x)=>{do{z+=n+" "}while(n++<x)});alert(z)}

Live Demo: http://codepen.io/anon/pen/BoeEGO?editors=001

Edit 1: saved 3 bytes changing the body of the inner function into for(;n<=x;)z+=n+++" " (and I feel good when the horizontal scrollbar of my snippet at last disappears :) )
f=r=>{z="";r.replace(/(?:(\d+).(\d+))/g,(m,n,x)=>{for(;n<=x;)z+=n+++" "});alert(z)}

Ungolfed
f=r=>{                                       // define a function with 'r' arg

  z="";                                      // initialize a variable to collect
                                             // the output

  r.replace(/(?:(\d+).(\d+))/g,(m,n,x)=>{    // for each range
                                             // where (m=range, n=min, x=max)
    for(; n<=x; ) {                          // until min <= max
      z += n++ + " "                         // add to z the value and a space
    }
  });

  alert(z)                                   // alert the output
}

f("(10-13, 11-15, 0-3, 9-9)");  // Output: 10 11 12 13 11 12 13 14 15 0 1 2 3 9

TeaScript, 18 + 1 = 19 bytes 20
+1 byte for "Inputs are arrays / lists?"  checkbox
Such abuse...
xße`r(${ls`-`}¬)`)

I've never abused JavaScript's casting more in my life.
Try it online
Ungolfed && Explanation
My favorite part is JavaScript arrays when cast to a string have commas auto-inserted. We abuse this so the array elements are inserted as numbers and as separate arguments. So 1-2, would become ['1','2'] but when string casted 1,2 and this can be put directly in a function.
xm(#e`r(${ls`-`}+1)`)

                        // The checkbox makes the input like ['1-2','3-4']
xm(#                )   // Loop through input
    e`             `    // Eval string...
      r(        +1)     // range function...
        ${ls`-`}        // Convert range -> args
                        // See above for more details

Python 2, 125 bytes
import re
print' '.join(map(lambda x:' '.join([str(y)for y in x]),eval(re.sub('(\d+)-(\d+)',r'range(\1,\2+1)',raw_input()))))

Try it online
I'm certain this could be golfed more...

CJam, 41 bytes (too long!)
Definitely can be golfed, but its a start. Test it online here.
l'(/e_')/e_',/{['-' er~]2,.+:,W%:-}%e_' *

l                                           e# Take string input
 '(/e_                                      e# Remove '( characters
      ')/e_                                 e# Remove ') characters
           ',/                              e# Split on commas
              {                   }%        e# Map over array...
               ['-' er~]                       e# Convert A-B to [A B]
                        2,.+                   e# Convert [A B] to [A B+1]
                            :,W%               e# Convert [A B+1] to [[0,1,2, ... B][0, 1, 2, ... A]]
                                :-             e# Remove element 1 of the previous array from element 2
                                    e_' *   e# Format nicely
                                            e# CJam prints stack after execution

A few tips: 1. To remove '(', do '(-; even better in this case: 1>; similarly, ')- or W< 2. To convert A-B to [A B], do '-/:~ 3. To convert [A B] to [A … B], do ~),> 4. Instead of e_ after the loop, you can do ~ at the end of the loop 5. Use S instead of '

O, 75 74 bytes
I'(-')-", "/]{[[n'-/]{n#}d[$,.$.0=0={.@=0={;.@=0=}w;}{;;}?r]]{n{noTo}d}d}d

This makes logical sense to anyone who built the language (i.e. me). The logic behind this is intense and I'm just happy that I got it working.
Try it online or RUN EVERY TEST CASE AT THE SAME TIME
Explanation:

I'(-')-", "/]    Format inputs into array
{                 Iterate over each input range
 [[n'-/]{n#}d     Split ranges into sets of numbers
 [$,              Get the second number and get a range from 0 to it
 .$.0=0=          Is the first number 0?
 {.@=0={;.@=0=}w;} True: Remove any unneeded numbers
 {;;}?             False: Pop some random stuff that shouldn't have been on there to begin with
 r]]              Reverse the range and close some array stuff or whatever
 {n{noTo}d}d}     Format output
}d

No idea what any of it does but good job.

Maybe would be better to specify the version too. As I see, your answers work only with the new C interpreter, but until you document it I will keep posting answers which work only with the old Java interpreter (like the 99 bottles of beer one).

@manatwork That answer actually works on the IDE. The C interpreter has most of the same features as the old one, and most old programs will work unless they do crazy stuff.

Hmm… Indeed. Maybe I tested only an older version of the code. But on thing is sure, was not the only time we didn't understood each other with the online interpreter.

Python 3, 76 bytes
l=eval(input().replace(*'-,'))
while l:a,b,*l=l;print(*range(a,b+1),end=' ')

The input is evaluated as a tuple by replacing each - with ,
(10-13, 11-15, 0-3) --> (10,13, 11,15, 0,3)

Then, the first two elements of the list are repeatedly lopped off and the numbers between them are printed.
Saved 2 bytes thanks to xsot.

'-',',' can be shortened to *'-,'.

@xsot Thanks. I wonder if there's something to be done with replace('-',',1+') to get the ranges right...

Mathematica, 80 bytes
Join@@BlockMap[Range@@FromDigits/@#&,StringCases[#,DigitCharacter..],2]~Row~" "&


text:
Loop Detection - not that kind!
The goal of this challenge is to find the direction and area enclosed by a loop.
Input:
A rectangular grid consisting entirely of these characters: ^v<>
(Optionally, you may also be given the dimensions of the grid before the grid itself in decimal with a prefix, suffix, and separator character of your choice.)
A loop in the grid is a set of the aforementioned characters such that one points to the next, pointing to the next, eventually pointing back at the first character. For example:
<>>v>     >>v
^^<>v     ^ >v
>^<<<     ^<<<
>^<v>

The left grid is the sample input; the right grid is the loop isolated.
The input grid will contain either no loops at all or one loop; you do not have to worry about any cases in which the grid contains more than one loop.
Output:
If the grid contains no loop, output X.
If the grid contains two arrows pointing at each other, output 0.
If the grid contains a counterclockwise loop, count the characters enclosed by the loop, including the border. Output that number.
If the grid contains a clockwise loop, follow the same process for the counterclockwise loop, but output the negative of that number. For instance, the above input grid would have an output of -11: 10 come from the loop itself, and 1 from the character enclosed by the loop.
This is code-golf. Shortest code wins.
Test cases:
<<^
^>v
^v<

Output X.
<<<<
><<<
>>^>

Output 0.
<>^^<
>>>v>
<^^>v
<^>>v
>^<<<

Output -15.
v<<<<
>v>>^
v<^<<
>>>>^

Output 20.

Why the downvotes? The question looks fine to me.

How do you determine if a loop is clockwise or not? For example, search "double spiral maze" on Google Images. How do you determine which way the path is running? Here's an example.

@ghosts_in_the_code That does not form a closed loop.

@MartinBüttner Imagine the outer two ends to connect to each other.

@ghosts_in_the_code Then one of the ends would have to turn around to meet the other. In that case you get an intersection free loop which can be unfolded into a circle to show whether it's going clockwise or counterclockwise. A simple test is to look at the bottom-most point of the loop and check if it's going left or right (in the case of the grid, that point is not unique, but you could look at the bottom-right-most cell of the loop and check if it's going left or up).

C#, 604 bytes
Complete program, accepts input (line-delimitated layout, no dimensions) from STDIN, outputs to STDOUT.

using C=System.Console;class P{static void Main(){int w=0,W,i,j,t,k,l,c;string D="",L;for(;(L=C.ReadLine())!=null;D+=L)w=L.Length;var R=new[]{-1,0,1,w,-w};L="X";for(W=i=D.Length;i-->0;){var M=new int[W];for(k=j=i;i>0;){M[j]=++k;t=j+R[c=D[j]%5];if(t<0|t>=W|c<3&t/w!=j/w|c>2&t%w!=j%w)break;j=t;if((l=M[j])>0){var J=new int[W+1];System.Func<int,int>B=null,A=s=>J[s]<0?0:J[k=B(s)]=k==W?k:i;B=x=>J[x]==x?x:B(J[x]);for(i=J[W]=W;i>0;)J[--i]=M[i]<l?i%w<1|i%w>w-2|i<w|i>W-w?W:i:-1;for(;i<W;)if(J[++i]<0)l=D[i]%5/2-1;else{A(i-1);if(i>w)A(i-w);}for(c=W;i-->0;L=""+(c>2?c:0)*l)c-=J[i]<0?0:B(i)/W;}}}C.WriteLine(L);}}

The program works by first reading in the layout, needless to say, and then iterating over every cell. We then run a 'snake' from each cell, which follows the arrows until it runs off the edge, or runs into itself. If it runs into itself, then we know we have found a loop (or one of those "><" things), and it also knows how much of the snake is in the loop.
Once we know we have a loop, we know which cells are on the loop, and we create a map from each cell (+1, for reasons) to either itself, -1 (means it's on the loop), or W (the whole width) if it's on the edge (or the +1 (which is at index W) to simplify things further one).
While we do this, we also find the direction that the 'last' element of the loop has (that is, the last element of the loop on the last row that has elements from the loop on it). This element must be a "<" or an "^", and this tells us the clockness (CW/CCW) of the loop (translated to -1/+1).
We then perform a disjoin set pass, which assigns all the elements that are outside the loop to the W set. We then subtract how many of these there are from W to get the number contained on and in the loop. If this number is less than 3, we replace it with 0. We multiply this by the clockness, set it as the result, and somehow escape from the for loops, where the result is output.
If, however, most of the above never happens (because no snake ever finds itself), then the result remains as "X", and that is outputted.
using C=System.Console;

class P
{
    static void Main()
    {
        int w=0, // width
        W, // full length
        i, // used for iterating over all the cells
        j, // keeps track of where the snake as got to
        t, // t is next j
        k, // how far along the snake we are, kind of
        // later on, k is used as temp for A
        l, // stores a threshold for how far along the snake the loop starts
        // later on, l stores the last seen pointer - this tells us the clockness
        c; // the translated direction
        // later on, c is a backwards-count

        string D="", // D is the map
        L; // used for reading lines, and then storing the result

        // might not be the best yay of doing this
        for(;(L=C.ReadLine())!=null; // read a line, while we can
            D+=L) // add the line to the map
            w=L.Length; // record the width

        var R=new[]{-1,0,1,w,-w}; // direction table (char%5) - might be able to replace this array with some bit bashing/ternary

        L="X"; // can't seem to fit this in anywhere... (don't strictly need to re-use L)
        for(W=i=D.Length;i-->0;) // for each cell, we send a 'snake' to try to find the loop from that cell
        {
            var M=new int[W]; // stores how far along the snake this point is

            for(k=j=i; // k's value doesn't really matter, as long as it's not stupidly big
                i>0;) // the i>0 check is just for when we return (see comment at the end of the code)
            {
                M[j]=++k; // store snake point and advance distance

                t=j+R[c=D[j]%5]; // t is position after move (translate <>v^ to 0234 (c is direction))
                //c=D[j]%5; // translate <>v^ to 0234 (c is direction)
                //t=j+R[c]; // t is position after move
                if(t<0|t>=W|c<3&t/w!=j/w|c>2&t%w!=j%w)
                    break; // hit an edge - will always happen if we don't find a loop - give up on this snake
                j=t; // move to new position

                if((l=M[j])>0) // we've been here before...
                {
                    // disjoint sets (assign all the edges to one set, assign all the ones on the line to another set, do adjacent disjoint, return size-outteredge (minus if necessary)
                    var J=new int[W+1]; // looks like we can reuse M for this

                    System.Func<int,int>B=null,
                    // whatever s points at should point to i, unless s points to W, in which case it should keep point to W
                    A=s=>J[s]<0?0:J[k=B(s)]=k==W?k:i;
                    // read the value this points to
                    B=x=>J[x]==x?x:B(J[x]);

                    for(i=J[W]=W;i>0;)
                        J[--i]=M[i]<l? // if we are not part of the loop
                            i%w<1|i%w>w-2|i<w|i>W-w? // if we are on the edge
                                W: // on the edge
                                i: // not on the edge
                             -1; // this is on the loop

                    // now fill in
                    // we don't have to worry about wrapping, the important bit being an un-wrapping closed loop
                    // i = 0
                    for(;i<W;)
                        if(J[++i]<0) // we are on the loop
                            l=D[i]%5/2-1; // last one must be ^(4) or <(0)
                        else{ // can probably crush this into an l returning l assigning term (with if above)
                            A(i-1);
                            if(i>w)
                                A(i-w);
                        }

                    // now count the number of non-edges
                    for(c=W; // assume everything is a non-edge
                        i-->0;
                        L=""+(c>2?c:0)*l) // set output to be number of non-edges * clockness (or 0 if too few)
                        c-=J[i]<0?0:B(i)/W; // subtract 1 if an edge (B(i) is W), othewise 0

                    // at this point, i is 0, so we will fall out of all the loops
                }
            }
        }

        C.WriteLine(L); // output result
    }
}


text:
Find maximal matching in divisibility relation
You are given a set of positive integers. You must arrange them into pairs such that:

Each pair contains 2 numbers, one of which is a multiple of another. For example, 8 is a multiple of 4, and 9 is a multiple of 9.
If the same number occurs many times in the initial set, it can be used that many times in the pairs; a number can even be paired with another occurence of the same number
The maximum possible number of pairs is obtained.

Output must be the number of pairs. Shortest code wins.
Sample data
2,3,4,8,9,18 -> 3
7,14,28,42,56 -> 2
7,1,9,9,4,9,9,1,3,9,8,5 -> 6
8,88,888,8888,88888,888888 -> 3
2,6,7,17,16,35,15,9,83,7 -> 2

Anyone know whether this problem is NP-complete? I think the smallest "hard" set is 2,3,4,8,9,18. (Each number in that list is a factor and/or multiple of at least two other numbers in the list, but it has only one solution.)

It is [assuming P!=NP] not NP-complete, as finding a maximum-cardinality matching is in P even in the general case (e.g. Hopcroft-Karp algorithm). On the other hand, this problem is at least as hard as maximal bipartite matchings (label one side with distinct primes, and the other side with appropriate products of them).

Haskell, 109 107 76 70 bytes
Thanks to nimi for saving 33 bytes and teaching me some more Haskell. :)
Thanks to xnor for saving another 6 bytes.
import Data.List
f l=maximum$0:[1+f t|a:b:t<-permutations l,a`mod`b<1]

Yay, my first Haskell golf. It works the same as all the answers so far (well, not quite: it only counts the length of the longest prefix of valid pairs in each permutation, but that's equivalent and is actually what my original CJam code did).
For extra golfitude it's also extra inefficient by recursively generating all permutations of the suffix each time the first two elements of a permutation are a valid pair.

Is the f= necessary?

@AlexA. I'm not sure what the standard policy on PPCG for unnamed functions in Haskell is, but I've checked a few other Haskell answers and they used named functions. Also, you'd technically have to use parentheses around the function if you wanted to use it as an unnamed function, so that would be the same byte count anyway I guess.

@nimi Thanks for letting me know. :) Do you see anything else that could be shortened? The import for chunksOf is painful. I don't really know Haskell's standard library to be able to tell if there is a shorter equivalent function. I tried implementing it myself, but it came out two or three bytes longer than the import.

ohhh, catching both [] and [_] at the same time by putting g x=[] second is really clever. I'll give that a try. Thanks :)

Looks a bit shorter to define the whole function recursively: f l=maximum$0:[1+f t|(a:b:t)<-permutations l,a`mod`b<1].

@xnor Heh, nice, who needs efficiency anyway. ;)

Japt -h, 11 bytes
My 1000th Japt solution! (According to SEDE)I had wanted to do something epic to mark the occasion but I couldn't find a suitable challenge and, also, realised I don't have the time or brainspace these days for epic. So, instead I shall "celebrate" with a victory over Jelly :) And a bag of cans, of course!
á ®ò xr'vÃñ

Try it
á ®ò xr'vÃñ     :Implicit input of array
á               :Permutations
  ®             :Map
   ò            :  Partitions of length 2
     x          :  Reduce by addition after
      r         :    Reducing each by
       'v       :    Testing divisibility
         Ã      :End map
          ñ     :Sort
                :Implicit output of last element

The 'v trick saves a byte over the more straightforward method of using a function which would be xÈrvÃ instead of xr'v, although we could get that byte back by replacing the ÃÃ with a newline.

CJam, 22 18 bytes
q~e!{2/::%0e=}%:e>

Try it online.
Expects input in the form of a CJam-style list.
This is a bit inefficient for larger lists (and Java will probably run out of memory unless you give it more).
Explanation
q~     e# Read and evaluate input.
e!     e# Get all distinct permutations.
{      e# Map this block onto each permutation...
  2/   e#   Split the list into (consecutive) pairs. There may be a single element at the
       e#   end, which doesn't participate in any pair.
  ::%  e#   Fold modulo onto each chunk. If it's a pair, this computes the modulo, which
       e#   yields 0 if the first element is a multiple of the second. If the list has only
       e#   one element, it will simply return that element, which we know is positive.
  0e=  e#   Count the number of zeroes (valid pairs).
}%
:e>    e# Find the maximum of the list by folding max() onto it.

It does not give output for [1 2 3 4 5 6 7 8 9 10] However [7 1 9 9 4 9 9 1 3 9 8 1] which is a longer list, works properly. Why is that?

@ghosts_in_the_code Because the former has more distinct permutations. 10! = 3628800, but 12! / 5! / 3! = 665280. So it runs out of memory for the first case. If you ran it from the console with the Java interpreter, you could tell Java to use more memory and the first case would work as well (although it might take a while, don't know).

Pyth, 13 bytes
eSm/%Mcd2Z.pQ

The time and storage complexity is really terrible. The first thing I do is to create a list with all permutations of the originally list. This takes n*n! storage. Input lists with length 9 already take quite a long time.
Try it online: Demonstration or Test Suite
Explanation:
eSm/%Mcd2Z.pQ
            Q   read the list of integer
          .p    create the list of all permutations
  m             map each permutation d to:
      cd2          split d into lists of length 2
    %M             apply modulo to each of this lists
   /     Z         count the zeros (=number of pairs with the first
                   item divisible by the second)
 S              sort these values
e               and print the last one (=maximum)

Mathematica, 95 93 87 83 79 60 58 bytes
Max[Count[#~Partition~2,{a_,b_}/;a∣b]&/@Permutations@#]&

Takes a few seconds for the larger examples.

Jelly, 12 bytes
Œ!s2ḍ/€ċ1Ʋ€Ṁ

Try it online!
Uses the same method as Jakube's Pyth answer and Martin's CJam answer, which seems to be the best method
How it works
Œ!s2ḍ/€ċ1Ʋ€Ṁ - Main link. Takes a list l on the left
Œ!           - All permutations of l
         Ʋ€  - Do the following over each permutation:
  s2         -   Split into pairs
      €      -   Over each pair:
     /       -     Reduce the pair by:
    ḍ        -       x divides y?
       ċ1    -   Count the 1s
           Ṁ - Take the maximum

Scala, 71 67 bytes
_.permutations.map(_.grouped(2)count(x=>x.size>1&&x(0)%x(1)<1)).max

Try it online!

-4 thanks to user!

Awesome answer! Save a couple bytes with _

05AB1E, 8 bytes
œεüÖιO}à

Try it online!
Commented:
œ          # get all permutations
 ε    }    # map over the permutations ... ex: [8, 4, 9, 9]
  üÖ       #   pairwise divisibility           [1, 0, 1]
           #     [8%4==0, 4%9==0, 9%9==0]
    ι      #   de-interleave                   [[1, 1], [0]]
           #     split into two alternating lists
     O     #   sum both lists                  [2, 0]
       à   # get the maximum

Husk, 10 bytes
▲mȯ#IĊ2Ẋ¦P

Try it online!
How?
▲mȯ#IĊ2Ẋ¦P
▲               # maximum of
 m              # map function over list:
  ȯ             # function: 3 functions combined
   #I           #   number of truthy elements of
     Ċ2         #   every second element of
       Ẋ        #   result of applying to every pair
        ¦       #   a divides b?
         P      # list: all permutations of input

Matlab (120+114=234)
  function w=t(y,z),w=0;for i=1:size(z,1),w=max(w,1+t([y,z(i,:)],feval(@(d)z(d(:,1)&d(:,2),:),~ismember(z,z(i,:)))));end

main:
  a=input('');h=bsxfun(@mod,a,a');v=[];for i=1:size(h,1) b=find(~h(i,:));v=[v;[(2:nnz(b))*0+i;b(b~=i)]'];end;t([],v)

the topper function is called by the main part.
the input is in the form [. . .]

Matlab(365)
  j=@(e,x)['b(:,' num2str(e(x)) ')'];r=@(e,y)arrayfun(@(t)['((mod(' j(e,1) ',' j(e,t) ')==0|mod(' j(e,t) ',' j(e,1) ')==0)&',(y<4)*49,[cell2mat(strcat(r(e(setdiff(2:y,t)),y-2),'|')) '0'],')'],2:y,'UniformOutput',0);a=input('');i=nnz(a);i=i-mod(i,2);q=0;while(~q)b=nchoosek(a,i);q=[cell2mat(strcat((r(1:i,i)),'|')) '0'];q=nnz(b(eval(q(q~=0)),:));i=i-2;end;fix((i+2)/2)

This apparently is longer, but oneliner and executive, and I managed to escape perms function because it takes forever.
This function takes many reprises to run quiet well due to anonymous functions, I m open to suggestions here :)

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/