|
@@ -198,7 +198,7 @@ namespace TEAMModelOS.Controllers.Common
|
|
|
}*/
|
|
|
foreach (var acs in info.task) {
|
|
|
if (!string.IsNullOrEmpty(acs.acId)) {
|
|
|
- if (acs.type.Equals("exam"))
|
|
|
+ if (acs.type == 1)
|
|
|
{
|
|
|
Azure.Response response = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(acs.acId, new PartitionKey($"Exam-{code}"));
|
|
|
if (response.Status == 200)
|
|
@@ -207,18 +207,8 @@ namespace TEAMModelOS.Controllers.Common
|
|
|
data.status = 404;
|
|
|
await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(data, data.id, new PartitionKey($"Exam-{code}"));
|
|
|
}
|
|
|
- }
|
|
|
- if (acs.type.Equals("survey"))
|
|
|
- {
|
|
|
- Azure.Response response = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(acs.acId, new PartitionKey($"Survey-{code}"));
|
|
|
- if (response.Status == 200)
|
|
|
- {
|
|
|
- Survey data = JsonDocument.Parse(response.Content).RootElement.Deserialize<Survey>();
|
|
|
- data.status = 404;
|
|
|
- await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(data, data.id, new PartitionKey($"Survey-{code}"));
|
|
|
- }
|
|
|
- }
|
|
|
- if (acs.type.Equals("homework"))
|
|
|
+ }
|
|
|
+ if (acs.type == 2)
|
|
|
{
|
|
|
Azure.Response response = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(acs.acId, new PartitionKey($"Homework-{code}"));
|
|
|
if (response.Status == 200)
|
|
@@ -390,7 +380,7 @@ namespace TEAMModelOS.Controllers.Common
|
|
|
{
|
|
|
foreach (var acs in tt.task)
|
|
|
{
|
|
|
- if (acs.type.Equals("exam"))
|
|
|
+ if (acs.type == 1)
|
|
|
{
|
|
|
var response = await client.GetContainer("TEAMModelOS", "Student").ReadItemStreamAsync(acs.acId, new PartitionKey($"Activity-{school}-{userid}"));
|
|
|
if (response.Status == 200)
|