Button/Autocomplete on Editor for Template Blocks

For new users, it would be nice to have a palette button to fill in a template for a multiple-choice block (or other commonly used question types, like pretzels).

Additionally, for users preferring to use a keyboard, it could be an autocomplete of that inserts a code block for

<answer name="" shuffleorder="false">
<choice credit=”1”></choice>
<choice></choice>
<choice></choice>
<choice></choice>
<choice></choice>
</answer>

Similarly, <pretzel-template> could insert a pretzel template that requires the user to simply add problems and answers without worrying about the individual components.

Better yet, it would be great to get user author-able code snippets where I can create my own snippet for whenever I type in , I get the multiple choice block with attributes set up exactly the way I like them.

I haven’t figured out a icon solution yet, but I was able to get the autocomplete invoked by < to include snippet templates and inject them if selected.

For example, if you type <mult and then select the multiple-choice-answer from the autocomplete list, it will insert the <answer> and <choice> tags similar to how you suggest.

We don’t yet have a way enable authors to code up these snippets for themselves. All the snippets are currently hard-coded.

In the meantime, what are autocomplete snippets that folks would like to have available? I could add more into the code.

(I haven’t yet merged in the changes with this feature, so there currently isn’t a way to test them.)

Hooray!

Pretzels with 12 or so problems would be another component that requires a fair bit of copy pasting or repetitive typing.

Do you think the problems should be annotated with a problem name at top like this or not?

<pretzel maxNumColumns="2">

  <!-- problem 1 -->
  <problem>
    <statement>
      
    </statement>
    <answer>
      
    </answer>
  </problem> 

  <!-- problem 2 -->
  <problem>
    <statement>
      
    </statement>
    <answer>
      
    </answer>
  </problem>

I think that’s helpful.

The autocomplete for these blocks is now live. There are just a few snippets in there right now: multiple-choice-answer, multiple-choice-select-multiple-answer, if-at-(immediate-feedback-assessment-technique)-answer, pretzel-n, table-with-tabular.

Check those out to see how they can be useful for you. Then suggest more snippets here.

May I request one for the following please?


<video name="video1" youtube="" ></video>
<p>Video credit achieved: 
  <number displayDecimals="1">$video1.fractionWatched*100</number>%</p>
<answer hide name="video1Credit">
  <award credit="$video1.fractionWatched">
    <when>true</when>
  </award>
</answer>
<callAction triggerWith="$video1" target="$video1Credit" actionName="submitAnswer" />