Permissions for STACK CAS-Chat

Permissions for STACK CAS-Chat

par Joel Scott,
Nombre de réponses : 10

I'm developing STACK Questions for a school and just moved over to using their server.

I use the caschat heavily for development (way quicker to get layout and feedback written and tested there before trying to do all the question fiddling)

Anyway, I don't have permission to access the caschat page, can anyone tell me what level of permissions one would need to request to be able to utilise that page?

Moyenne des évaluations  -
En réponse à Joel Scott

Re: Permissions for STACK CAS-Chat

par Marcus Green,
Avatar Core developers Avatar Particularly helpful Moodlers Avatar Plugin developers Avatar Testers

I have been very focussed on STACK recently but I did not know that existed. The code for the caschat.php file includes the following lines which might give a clue

If there is no questionid parameter given

require_capability('qtype/stack:usediagnostictools', $context); 

Otherwise 

question_require_capability_on($questiondata, 'edit'); 

Can you give examples of how you use it?

En réponse à Marcus Green

Re: Permissions for STACK CAS-Chat

par Joel Scott,
Hi Marcus,

The maths I'm doing is really simple (upper primary/lower highschool level) but I'm trying to provie rich feedback and randomisation (hence STACK). The biggest thing I'm using the caschat for is the html and making sure that the layout and formatting of answers is appropriate. My html is improving but the nature of working within Moodle is a bit of a limiting factor so I'm becoming something of a master in 'worst-practice' html (all my styling is done in tags since we can't [at least I can't] do proper css).

At present I'm playing with feedback for vertical subtraction so I'm using the caschat for stuff like the below. I write the maxima and html in Visual Studio Code, copy that across to the Caschat for testing, then in theory I can just put that straight into a question and have minimal tweaking/troubleshoting in the slower question interface... (At least that's the theory).

Question Variables:
n1: rand(9000)+1000;
n2: rand(9000)+1000;
aa: max(n1,n2);
bb: min(n1,n2);
ta: aa-bb;
colour1: red;
colour2: blue;
colour3: green;

digitlist(n) := if integerp(n) and n > -1 then digitlist_helper(n,[]);
digitlist_helper(n,acc) := block([p],
  if n < 10 then cons(n,acc) else (
    p : mod(n,10),
    digitlist_helper(floor((n-p)/10), cons(p,acc))));
borrow(nnDigits,i) := block(
  if(nnDigits[i]#9) then nnDigits[i]:nnDigits[i]+10,
  if nnDigits[i-1]>0 then nnDigits[i-1]:nnDigits[i-1]-1
  else block(nnDigits[i-1]:9,borrow(nnDigits,i-1)),
  return(nnDigits)
)
aaDigits: digitlist(aa);
aaLen: length(aaDigits);
bbDigits: digitlist(bb);
taDigits: digitlist(ta);
debugString:"";
for i:1 while length(bbDigits) < aaLen do (
  bbDigits: push(0,bbDigits)
);
for i:1 while length(taDigits) < aaLen do (
  taDigits: push(0,taDigits)
);
borDigits: aaDigits;
for i:aaLen thru 1 step -1 do (
  if borDigits[i]<bbDigits[i] then borDigits: borrow(borDigits,i)
  else borDigits[i]:aaDigits[i],
  debugString: sconcat("Step ",i,": ",borDigits, debugString)
)
aaDigits: digitlist(aa);
aaDigitsOriginal: digitlist(aa);
minuend :"<td style=\"min-width:40px;text-align:right;font-weight:bold;\"></td>";
for i:1 thru aaLen step 1 do (
  td: sconcat("<td style=\"min-width:40px;text-align:right;font-weight:bold;\">",aaDigits[i],"</td>"),
  minuend: sconcat(minuend, td)
)

minuend_bor :"<td style=\"min-width:40px;text-align:right;font-weight:bold;\"></td>";
borrowing: makelist(0,aaLen);
for i:1 thru aaLen step 1 do (
  if aaDigits[i]=borDigits[i] then td: sconcat("<td style=\"min-width:40px;text-align:right;font-weight:bold;\">",aaDigits[i],"</td>")
  else td: sconcat("<td style=\"color:",colour2,";min-width:40px;text-align:right;font-weight:bold;\"> <span style=\"color:",colour1,";text-decoration:line-through\">",aaDigits[i],"</span> ",borDigits[i]," </td>"),
  borrowing[i]: td,
  minuend_bor: sconcat(minuend_bor, td)
)
subtrahend :"<td style=\"min-width:40px;text-align:right;font-weight:bold;\">\\(-\\)</td>";
for i:1 thru aaLen step 1 do (
  td: sconcat("<td style=\"min-width:40px;text-align:right;font-weight:bold;border-bottom: solid 1px black;\">",bbDigits[i],"</td>"),
  subtrahend: sconcat(subtrahend, td)
)
ones: sconcat("<p>In the ones place, we have \\(", aaDigits[aaLen]," - ", bbDigits[aaLen],"\\)<p>")
if aaDigits[aaLen]>=bbDigits[aaLen] then ones: sconcat(ones,"<p>No borrowing is needed</p>")
else block(
  ones: sconcat(ones,"<p>We need to borrow \\(10\\) from the tens place</p>"),
  if aaDigits[aaLen-1]>0 then block(
    ones:sconcat(ones, "<p>So we subtract one from \\(", aaDigits[aaLen-1], "\\)  to get \\(", aaDigits[aaLen-1]-1, "\\) in the tens place and add \\(10\\) to the ones place.</p>", "<p>Now the ones place looks like:</p>", "<table><tbody><tr>", borrowing[aaLen], "</tr></tbody></table>"),
    aaDigits[aaLen-1]: aaDigits[aaLen-1]-1,
    aaDigits[aaLen]:aaDigits[aaLen]+10
  )
  else block(
    ones:sconcat(ones, "<p>Since there are no tens, we need to borrow from the hundreds place</p>"),
    if aaDigits[aaLen-2]>0 then block(
        ones:sconcat(ones, "<p>So we subtract one from \\(", aaDigits[aaLen-2], "\\)  to get \\(", aaDigits[aaLen-2]-1, "\\) in the hundreds place</p>","<p>We then put a \\(9\\) the tens place and add \\(10\\) to the ones place:</p>", "<table><tbody><tr>", borrowing[aaLen], "</tr></tbody></table>"),
        aaDigits[aaLen-2]: aaDigits[aaLen-2]-1,
        aaDigits[aaLen-1]: 9,
        aaDigits[aaLen]:aaDigits[aaLen]+10
    )
    else block(
      ones:sconcat(ones, "<p>Since there are no hundreds, we need to borrow from the thousands place</p>"),
      if aaDigits[aaLen-3]>0 then block(
        ones:sconcat(ones, "<p>So we subtract one from \\(", aaDigits[aaLen-3], "\\)  to get \\(", aaDigits[aaLen-3]-1, "\\) in the thousands place</p>","<p>We then put a \\(9\\) in the hundreds place and a \\(9\\) in the tens place and add \\(10\\) to the ones place:</p>", "<table><tbody><tr>", borrowing[aaLen], "</tr></tbody></table>"),
        aaDigits[aaLen-3]: aaDigits[aaLen-3]-1,
        aaDigits[aaLen-2]: 9,
        aaDigits[aaLen-1]: 9,
        aaDigits[aaLen]:aaDigits[aaLen]+10
      )
    )
  )
)
ones:sconcat(ones,"<p>\\(", aaDigits[aaLen]," - ", bbDigits[aaLen],"=\\)<span style=\"color:",colour3,";\">\\(",taDigits[aaLen],"\\)</span></p>");
tens: sconcat("<p>In the tens place, we have \\(", borDigits[aaLen-1]," - ", bbDigits[aaLen-1],"\\)<p>")
if aaDigits[aaLen-1]>=bbDigits[aaLen] then tens: sconcat(tens,"<p>No borrowing is needed</p>")
else block(
  tens: sconcat(tens,"<p>We need to borrow \\(10\\) from the hundreds place</p>"),
  if aaDigits[aaLen-2]>0 then tens:sconcat(tens, "<p>So we subtract one from \\(", aaDigits[aaLen-2], "\\)  to get \\(", aaDigits[aaLen-2]-1, "\\) in the hundreds place add \\(10\\) to the tens place</p>", "<p>Now the tens place looks like:</p>", "<table><tbody><tr>", borrowing[aaLen-1], "</tr></tbody></table>")
  else block(
    tens:sconcat(tens, "<p>Since there are no hundreds, we need to borrow from the thousands place</p>"),
    if aaDigits[aaLen-3]>0 then tens:sconcat(tens, "<p>So we subtract one from \\(", aaDigits[aaLen-3], "\\)  to get \\(", aaDigits[aaLen-3]-1, "\\) in the thousands place</p>","<p>We then put a \\(9\\) the hundreds place and add \\(10\\) to the tens place:</p>", "<table><tbody><tr>", borrowing[aaLen-1], "</tr></tbody></table>")
    )
  )
Question Variables:
<table>
  <tbody>
    <tr>
      {@minuend@}
    </tr>
    <tr>
      {@subtrahend@}
    </tr>
  </tbody>
</table>
<br>
<br>
{@ones@}
<br>
{@tens@}

<br>
<br>
<p>After all borrowing is completed, the problem looks like:</p>

<table>
  <tbody>
    <tr>
      {@minuend_bor@}
    </tr>
    <tr>
      {@subtrahend@}
    </tr>
  </tbody>
</table>
En réponse à Joel Scott

Re: Permissions for STACK CAS-Chat

par Andreas Steiger,
Avatar Plugin developers
If you regularly develop many questions like this and the CASChat functionality is useful for you, you might also consider setting up your own Moodle box on your computer, with the same versions as your production environment. It takes a few hours of work to get it running, but then you can do whatever you want.
En réponse à Andreas Steiger

Re: Permissions for STACK CAS-Chat

par Joel Scott,
Thanks Andreas,

Thats what I already do, I was hoping to move things off muy server, mostly so that I can upskill oher members of the team, options at this point are a parallel server somewhere else on the web, beg ane plead for higher permissions on the moodle server or cry to Chris... My money's on the first being the solution that gets me there.
En réponse à Joel Scott

Re: Permissions for STACK CAS-Chat

par Christopher Sangwin,
Avatar Plugin developers

Joel,

A general question author can access this page by navigating to the "STACK question dashboard" and then using the "Send general feedback to the CAS".  It's the same page, and it has the advantage that you can save the question variables and general feedback directly back to a question.

Just to note, I also make extensive use of the sandbox.
https://docs.stack-assessment.org/en/CAS/STACK-Maxima_sandbox/

Chris

En réponse à Christopher Sangwin

Re: Permissions for STACK CAS-Chat

par Joel Scott,
Thanks Chris,

That's really helpful, but I can't see how to access the dashboard other than for a specific (pre-existing) question. Is there a way to access it directly or do I need to have created a minimally working question first?

Cheers,

Joel
En réponse à Joel Scott

Re: Permissions for STACK CAS-Chat

par Christopher Sangwin,
Avatar Plugin developers

Exactly Joel,

You have to create a minimal working question (which then has a question id in the database), access the dashboard, and then the "chat".  That way you can save back to the existing question.

Chris

En réponse à Christopher Sangwin

Re: Permissions for STACK CAS-Chat

par Joel Scott,
I had a bit more of a look at that Chris, unfortunately it doesn't allow me to play with the question text (unless I'm missing something) which is the primary purpose I use the caschat for.

Does one need full administrator level privileges to access the 'full show'?

Joel
En réponse à Joel Scott

Re: Permissions for STACK CAS-Chat

par Christopher Sangwin,
Avatar Plugin developers

Joel,

Well, no you can't play with the question text directly.  There was a "question preview" feature already for that, but of course that requires saving the question.  I don't want to "fight against" moodle's design too much by supporting parallel preview mechanisms.  The worked solution was so difficult to preview that I made an exception here!

Chris

En réponse à Christopher Sangwin

Re: Permissions for STACK CAS-Chat

par Joel Scott,
No worries,

I think I'm again pushing the boundaries with trying to write comparatively complex html (I randomised a sieve on 1-100 table to show common multiples for example) this is where the CasChat is really important to me, there is no way I'm going to get the Maxima generated html right on the 1st (or 21st) try and waiting for the reloading of two pages ends up being a pretty significant time increase. Same with writing the detailed feedback (albeit for simple maths... I still can't work out a good way of assessing vertical subtraction techniques...)

Anyway, I guess I can just keep using my local machine for design work and if I need anyone else onboard, I'll spin up a web server just for that.

Thanks for all you do on STACK!