Difference between revisions of "Insert video into question"
(v1.2) (Tag: visualeditor) |
(v1.7) (Tag: visualeditor) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
This page will guide you how to insert a video file (as attachment) into the question. | This page will guide you how to insert a video file (as attachment) into the question. | ||
+ | |||
+ | '''PLEASE REMEMBER THAT THIS GUIDE JUST BE FOR QUESTIONNAIRE WHICH HAVE USER FOR QAS.''' | ||
+ | |||
+ | Do not implement for QUESTIONNAIRE HAVE NO USER FOR QAS. | ||
Please follow these steps: | Please follow these steps: | ||
Line 9: | Line 13: | ||
- Click "Add" button and choose your file, then you finish with "Save" button. | - Click "Add" button and choose your file, then you finish with "Save" button. | ||
− | - Next, You go to "Tools/Projects and folders/Attachment" then search your attachment by searching function. You get link of attachment in "Link" Column of searching result. | + | - Next, You go to "Tools/Projects and folders/Attachment" then search your attachment by searching function. You get link of attachment in "Link" Column and get resource Id in Resource Id column of searching result. |
You are done this step. Look at next step to see how to generate HTML code. | You are done this step. Look at next step to see how to generate HTML code. | ||
Line 33: | Line 37: | ||
[[File:Put HTML code into question's HTML.png|none|thumb|1536x1536px]] | [[File:Put HTML code into question's HTML.png|none|thumb|1536x1536px]] | ||
− | '''4. | + | '''4. Grant Permissions:''' |
+ | |||
+ | You must create a dumy question before your question, replace "%resource Id%" by resource Id of attachment (in step 1) in below code, then put it into cgscript tab of question.<syntaxhighlight lang="c#" line="1"> | ||
+ | if(getRPQUserId() != empty) | ||
+ | { | ||
+ | array permissions = { {getRPQUserId(), "Read"}}; | ||
+ | updateUserPermission("%resource Id%", permissions); | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | '''5. Set Impersonation of Questionnaire.''' | ||
+ | |||
+ | You must set "Impersonation" configuration of questionnaire to user who has permission on video attachment. | ||
+ | [[File:Set Impersonation.png|none|thumb|950x950px]] | ||
+ | |||
+ | '''6. Test.''' | ||
+ | |||
+ | When you test your questionnaire, you need to use n=2 when doing testlinks else please add some information about that. | ||
− | + | End of document. | |
+ | [[Category:Questionnaire]] |
Latest revision as of 11:08, 19 June 2018
This page will guide you how to insert a video file (as attachment) into the question.
PLEASE REMEMBER THAT THIS GUIDE JUST BE FOR QUESTIONNAIRE WHICH HAVE USER FOR QAS.
Do not implement for QUESTIONNAIRE HAVE NO USER FOR QAS.
Please follow these steps:
1. Add an attachment and get the link of video file.
First, You need to add a attachment to Catglobe system via Attachment Tab of Questionnaire.
- Click "Add" button and choose your file, then you finish with "Save" button.
- Next, You go to "Tools/Projects and folders/Attachment" then search your attachment by searching function. You get link of attachment in "Link" Column and get resource Id in Resource Id column of searching result.
You are done this step. Look at next step to see how to generate HTML code.
2. Generate HTML code
With this step, You just need to copy below codes and replace "%Link%" by your link by your link.
1 <video controls="" autoplay="" width="300" height="200">
2 <source type="video/ogg" src="%Link%" />
3 <source type="video/mp4" src="%Link%" />
4 <source type="video/webm" src="%Link%" />
5 Your browser does not support the<video>element.</video>
6 </video>
3. Put into question's HTML
You put HTML code prepared at step 2 into question's HTML.
4. Grant Permissions:
You must create a dumy question before your question, replace "%resource Id%" by resource Id of attachment (in step 1) in below code, then put it into cgscript tab of question.
1 if(getRPQUserId() != empty)
2 {
3 array permissions = { {getRPQUserId(), "Read"}};
4 updateUserPermission("%resource Id%", permissions);
5 }
5. Set Impersonation of Questionnaire.
You must set "Impersonation" configuration of questionnaire to user who has permission on video attachment.
6. Test.
When you test your questionnaire, you need to use n=2 when doing testlinks else please add some information about that.
End of document.