Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqiMaster committed Aug 26, 2020
1 parent 87207c3 commit 36a8bbb
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 12 deletions.
2 changes: 1 addition & 1 deletion umpleonline/scripts/allumple-min.js

Large diffs are not rendered by default.

16 changes: 13 additions & 3 deletions umpleonline/scripts/umple_action.js
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,14 @@ Action.submitTaskWorkCallback = function(response)
{
window.alert("Successfully submitted Task!");
var responseArray = response.responseText.split("task submit delimiter");
window.location.href = responseArray[0] + "?task=" + responseArray[1] + "&url=" + responseArray[2];
if (responseArray[0] == "")
{
window.location.href = responseArray[2];
}
else
{
window.location.href = responseArray[0] + "?task=" + responseArray[1] + "&url=" + responseArray[2];
}
}

Action.launchParticipantURL = function()
Expand All @@ -632,8 +639,9 @@ Action.launchParticipantURL = function()
Action.copyParticipantURL = function()
{
var taskname = Page.getModel().split("-")[1];
Action.copyToClp(window.location.hostname + window.location.pathname + "11/bookmark.php?loadTaskWithURL=1&taskname=" + taskname + "&model=" + taskname);
Page.setFeedbackMessage("Participant URL is in copy buffer: " + window.location.hostname + window.location.pathname + "/bookmark.php?loadTaskWithURL=1&taskname=" + taskname + "&model=" + taskname);
var copiedURL = window.location.hostname + window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/')) + "/bookmark.php?loadTaskWithURL=1&taskname=" + taskname + "&model=" + taskname;
Action.copyToClp(copiedURL);
Page.setFeedbackMessage("Participant URL is in copy buffer: " + copiedURL);
}

Action.copyToClp = function(txt){
Expand Down Expand Up @@ -666,6 +674,8 @@ Action.openInstructionInNewTab = function()
winPrint.document.write("<!DOCTYPE html><html><head><title>Instructions</title></head><body>" + jQuery("#instructionsHTML").html() + "</body></html>");
winPrint.document.close();
winPrint.focus();
jQuery("#instructionsHTML").html("");
jQuery("#labelInstructions").css("display", "none");
}

Action.saveNewFile = function()
Expand Down
41 changes: 33 additions & 8 deletions umpleonline/umple.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,17 +260,41 @@
<th id="labelCompletionURL"><label>Completion Survey URL:</label></th>
</tr>
<tr>
<th id="taskNameCell" style="display: none;"><input type="text" id="taskName" name="fname"></th>
<th><input type="text" id="requestorName"></th>
<th id="completionURLCell" ><input type="text" id="completionURL" width="70ch"></th>
<th id="isExperiment" style="display: none;" title=" Check this if this task is an experiment and full details of every interaction the user does needs to be recorded. You should have received ethics approval before sending such a task to users."><input type="checkbox" value="isExperiment"><label>isExperiment</label></th>
<th id="taskNameCell" style="display: none;" title="This name should describe the experiment or course assignment.
It can contain alphanumeric characters as well as _ and .
It is case sensitive. Responders will be able to use this
to look up the task from the 'Load a task' menu item"><input type="text" id="taskName" name="fname"></th>
<th title="This is optional. It will help reassure responders that they
are responding to the correct task for the correct person
or organization."><input type="text" id="requestorName"></th>
<th id="completionURLCell" title="This is optional. Upon submitting a task, UmpleOnline will
take responders to this URL with two arguments: task: the task name
url: the URL of the completed task (with the model read-only)
Requestors can use this to gather responses and/or
to ask survey questions about the experiment or assignment"><input type="text" id="completionURL" width="70ch"></th>
<th id="isExperiment" style="display: none;" title=" Check this to initiate logging of every command the user does.
You should have ethics committee approval if you wish to use this
and publish the results. Also, you should
When you download the task you will be able to analyse the
complete evolution of the model as the user works on it."><input type="checkbox" value="isExperiment"><label>isExperiment</label></th>
</tr>
</table>


<label id="labelInstructions" for="instructions">Task Instructions:</label>
<b><label id="labelInstructions" for="instructions">Task Instructions:</label></b>
<div id="instructionsHTML"></div>
<textarea id="instructions" style="display: none;"> <?php if ($doLoadTaskInstruction && !isset($_REQUEST["task"])) {echo "readonly";}?>></textarea>
<textarea id="instructions" style="display: none;" title="Write task instructions in Markdown format.
Lines starting with # are headings
Lines starting with * are bullet points
URLs will become links that take a user to another tab
(You can use such URLs to tell users where to find more information
about the task)
The instructions might be requirements you want responders to
implement. You can also create a complete model in the main
area and then ask for reponders to make changes.
If you need to be able to identify the responders you should
ask them to include their name and/or ID in a comment
in their model."></textarea>

<div style="margin-top: 5px;">
<?php if (!isset($_REQUEST["task"]) && !$doLoadTaskInstruction) { ?>
Expand All @@ -290,8 +314,9 @@
download all the responses unless you cancel the submission.">Launch Participant URL in a new tab</a>
<?php } else if ($doLoadTaskInstruction && substr($dataHandle->getName(), 0, 8) != "taskroot" && !$readOnly) {?>
<a class="button2" href="javascript:Action.openInstructionInNewTab()">Open instruction in a new window</a>&nbsp;&nbsp;&nbsp;
<a class="button2" href="javascript:Action.submitTaskWork()" title="Click to indicate that you have finished the task.
If the requestor has asked you to, also send the URL to the requestor">Submit Your Work</a>&nbsp;&nbsp;&nbsp;
<a class="button2" href="javascript:Action.submitTaskWork()" title=" When you submit, the requestor will be able to see your response
and it will no longer be editable. Make sure your name is in a
comment in the response if that has been requested in the instructions.">Submit Response</a>&nbsp;&nbsp;&nbsp;
<a class="button2" href="javascript:Page.cancelTaskResponse()" title="Cancel this submission. Your data will be deleted.">Cancel this task response</a>
<!-- all your subsequent work will not be saved -->
<?php } else if ($readOnly) {?>
Expand Down

0 comments on commit 36a8bbb

Please sign in to comment.